tags:

views:

791

answers:

1

i am picking up phpunit. i am at the phpunit.xml file.

i want to understand what does each element do.

<testsuite name="application">
    <directory>application</directory>
</testsuite>

the directory refers to the dir containing all the *Test.php files?

<filter>
    <whitelist>
        <directory suffix=".php">../application</directory>
        <exclude>
            <directory suffix=".php">../library</directory>
            <directory suffix=".phtml">../application</directory>
            <file>../application/bootstrap.php</file>
            <file>../application/scripts/doctrine.php</file>
        </exclude>
    </whitelist>
</filter>

whilelist refers to the application files (not test.php) that are supposed to be covered? so in this example, i am saying i want all php files in ../application to be covered, except php files in ../library, phtml files in ../application, and the bootstrap.php and doctrine.php?

+1  A: 

Not sure what kind of answer you're waiting for, but you seem to be right, in both cases.

For the second point :

  • the idea is to get code coverage for all your PHP files, even those in which there is no tested code : this way, you get some "real" code-coverage (and not only the code coverage on files that are used by tested code).
  • and the exclusions are here so you don't have code-coverage for the frameworks -- there is no point in testing the frameworks, and considering the huge amount of code there are made of, it would influence your code coverage a lot.

For more informations :

Pascal MARTIN
wont blacklist > exclude be the same as whitelist? and whitelist > exclude be blacklist?
iceangel89