Test
The test command runs the PHPUnit tests associated with your web app, modules and packages. PHPUnits full documentation can be found here.
Test will look for the PHPUnit configuration file named phpunit.xml
in the APPPATH
or COREPATH
directories.
PHPUnit Configuration
Fuel has a basic phpunit.xml to test its internal code. This file is located at fuel/core/phpunit.xml
and contains
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" stopOnFailure="false" bootstrap="../core/bootstrap_phpunit.php">
<php>
<server name="doc_root" value="../../"/>
<server name="app_path" value="fuel/app"/>
<server name="core_path" value="fuel/core"/>
<server name="package_path" value="fuel/packages"/>
</php>
<testsuites>
<testsuite name="core">
<directory suffix=".php">../core/tests</directory>
</testsuite>
<testsuite name="packages">
<directory suffix=".php">../packages/*/tests</directory>
</testsuite>
<testsuite name="app">
<directory suffix=".php">../app/tests</directory>
</testsuite>
</testsuites>
</phpunit>
If you use Modules, you may want the following additional test suite added in your customized version
<testsuite name="modules">
<directory suffix=".php">../modules/*/tests</directory>
</testsuite>
Command Line Options
Test supports several PHPUnit command line options
--group
Only runs tests from the specified group(s).
--exclude-group
Exclude tests from the specified group(s).
--coverage-clover <file>
Generate code coverage report in Clover XML format.
--coverage-html <dir>
Generate code coverage report in HTML format.
--coverage-php <file>
Serialize PHP_CodeCoverage object to file.
--coverage-text=<file>
Generate code coverage report in text format.