Trac

Howto run the tests for Doctrine

Doctrine is testing using UnitTests.

In order to run the tests that come with doctrine you need to check out the entire project, not just the lib folder.

Brower

You can run the unit tests in the browser by navigating to doctrine/tests/run.php

F.eks:

http://doctrine.pengus.net/doctrine/tests/run.php

Options

Options can be provided through _GET variables:

http://doctrine.pengus.net/doctrine/tests/run.php?filter=Limit&group[]=query&group[]=record

CLI

You can also run the tests on the command line. In order to run the tests on the CLI you need to have php-cli installed in your environment.

Navigate to the DOCTRINE_PATH/tests folder and run the following command:

php run.php

This should print out a progress indicator and at the end a report of test failures if any.

The CLI testrunner has several options. In order to see them use the following command:

php run.php -help

Options

  • create coverage report with the -coverage switch. This requires Xdebug. Coverage report can be seen in DOCTRINE_PATH/tests/cc.php
  • run a group of tests with the -group switch
  • filter tests against classnames of testssuites with -filter switch

See the -help switch for more details.