PHPunit如何排除目录中的所有文件但不排除子目录

PHPunit how to exclude all files in directory but not exclude subdirectories

我有这样的问题。我想排除 SomeBundle\Entity 中的所有文件,但不想排除 SomeBundle\Entity\Repository 和 SomeBundle\Entity\Factory.

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\Entity ...

<?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>