New: Add phpunit tests

This commit is contained in:
Laurent Destailleur 2010-04-27 00:06:29 +00:00
parent 0e5b5b9946
commit e921149135
4 changed files with 18 additions and 31 deletions

View File

@ -17,6 +17,6 @@ Run > phpunit TestFile.php
If using Eclipse, select the test and click on menu "Run external tools and choose PHPUnit". If using Eclipse, select the test and click on menu "Run external tools and choose PHPUnit".
* Generate a report of Unit tests code coverage: * Generate a report of Unit tests code coverage:
Run > phpunit --coverage-html ./report MyTestSuite.php Run > phpunit [--configuration ./phpunittestok.xml] --coverage-html ./report MyTestSuite.php
Note that xdebug must be installed for this feature to work. Note that xdebug must be installed for this feature to work.

View File

@ -1,30 +0,0 @@
<phpunit backupGlobals="false"
backupStaticAttributes="true"
bootstrap="/path/to/bootstrap.php"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="true"
stopOnFailure="true"
syntaxCheck="false"
testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader">
<filter>
<blacklist>
<directory suffix=".php">/path/to/files</directory>
<file>/path/to/file</file>
<exclude>
<directory suffix=".php">/path/to/files</directory>
<file>/path/to/file</file>
</exclude>
</blacklist>
<whitelist>
<directory suffix=".php">/path/to/files</directory>
<file>/path/to/file</file>
<exclude>
<directory suffix=".php">/path/to/files</directory>
<file>/path/to/file</file>
</exclude>
</whitelist>
</filter>
</phpunit>

10
test/phpunittestko.xml Normal file
View File

@ -0,0 +1,10 @@
<phpunit>
<filter>
<blacklist>
<directory suffix=".php">../test/</directory>
</blacklist>
<whitelist>
<directory suffix=".php">../htdocs/</directory>
</whitelist>
</filter>
</phpunit>

7
test/phpunittestok.xml Normal file
View File

@ -0,0 +1,7 @@
<phpunit>
<filter>
<blacklist>
<directory suffix=".php">../test/</directory>
</blacklist>
</filter>
</phpunit>