Skip to content
This repository has been archived by the owner on Aug 25, 2019. It is now read-only.

Testing

Dietrich Moerman edited this page Jul 29, 2012 · 8 revisions

Unit tests

Every part of the framework and every module must define tests in its Tests directory. These are defined in files named *Test.php which contain a class (named equal to the file name minus extension) that extend UseBB\Tests\TestCase.

The UseBB\Tests\TestCase class extends the PHPUnit test case class and adds useful features. Please see the source code and existing test cases for details and usage.

Coverage

The coverage should be (or close to) 100%. Exceptions can be made which are either excluded from coverage or marked as covered by an existing test (such as private methods).

When running the tests, an HTML coverage report is generated in coverage/.

Running

Ensure the testing database is installed using:

$ php index.php --env=testing --install-db

Run the tests using phpunit .. The configuration is read from phpunit.xml.