2017-08-01 163 views
0

我有这样的问题。我想排除SomeBundle \ Entity中的所有文件,但不想排除SomeBundle \ Entity \ Repository和SomeBundle \ Entity \ Factory。PHPunit如何排除目录中的所有文件但不排除子目录

SomeBundle\Entity 
SomeBundle\Entity\Repository 
SomeBundle\Entity\Factory 

SomeBundle\Entity\File1.php 
SomeBundle\Entity\File2.php 
SomeBundle\Entity\File3.php 

我试图用

<filter> 
     <whitelist> 
      <directory>./../src/SomeBundle</directory> 
      <exclude> 
       <directory suffix=".php">./../src/SomeBundle/Entity</directory> 
      </exclude> 
     </whitelist> 
    </filter> 

做,但作为一个结果,我排除了所有在SomeBundle \实体...

回答

0
<?xml version="1.0" encoding="UTF-8"?> 
<phpunit colors="true"> 
    <testsuites> 
     <testsuite name="Test Suite"> 
      <directory>SomeBundle</directory> 
      <directory>SomeBundle/Entity/**</directory> 
      <exclude>SomeBundle/Entity</exclude> 
     </testsuite> 
    </testsuites> 
</phpunit>