2012-08-29 4 views
3

모든 하위 클래스의 클래스를 테스트해야합니다. 그러나 큰 리팩토링을 수행 할 때까지는이 하위 폴더의 다른 파일을 테스트하고 싶지 않습니다.접두사를 사용하는 PHPUnit 테스트 파일

모두 테스트하려는 파일은 class.으로 시작합니다. class.apis.php, class.something.php.

<?xml version="1.0" encoding="UTF-8"?> 
<phpunit backupGlobals="true" backupStaticAttributes="true" colors="true" 
    convertErrorsToExceptions="true" 
    convertNoticesToExceptions="true" convertWarningsToExceptions="true" 
    processIsolation="false" 
    stopOnFailure="false" syntaxCheck="true" verbose="true" 
    strict="true"> 
    <php> 
     <includePath>../</includePath> 
    </php> 

    <testsuites> 
     <testsuite name="MSBO Test Suite"> 
      <directory>PHPUnit</directory> 
     </testsuite> 
    </testsuites> 

    <filter> 
     <whitelist addUncoveredFilesFromWhitelist="true"> 
      <directory suffix=".php">../classes/</directory> 
      <directory suffix=".php">../modules/</directory> 
      <exclude> 
       <directory>../classes/external/</directory> 
      </exclude> 
     </whitelist> 
    </filter> 
</phpunit> 

을하지만 난 화이트리스트에 접두사를 추가하는 방법에 아무것도 찾을 수 없습니다

그래서, 내 테스트를 실행하기 위해 나는 phpunit을위한 folloring 구성을 가지고있다. 어떤 아이디어?

+0

@lkessler - 제발 이것을 사용하지 마십시오. 이들은 주제에서 벗어나 사이트 전체에 깃발을 꽂습니다. 나는 다른 사람들을 제거 할 것이다. –

답변

2

우리는 대신 접두사, 다른 확장을 사용, 그래서 우리는이 :

<directory suffix=".class">lib/UTIL</directory> 

당신은 내가이 시도하지 않은 있지만, 파일 이름 필터에 와일드 카드를 사용할 수 있습니다.

+0

나는 그것을 시도했지만, 불행히도, 작동하지 않았다. –

+0

접미사에서 접미어로 이름을 바꿀 수 있습니까? 그렇지 않다면 PHPUnit의 버그 목록에 프리픽스 지원을 요청할 수 있습니까? –

+0

다른 해결책이 없다면, 그렇습니다 ... 나는 그런 식으로해야한다고 생각합니다. –

관련 문제