Note:

This site is no longer used and is in read-only mode. Instead please go to our new Moodle Developer Resource site.

PHPUnit: Difference between revisions

From MoodleDocs
Line 15: Line 15:
=Configuration of server before first test execution=
=Configuration of server before first test execution=


Our PHPUnit integration requires a dedicated database and dataroot. Before the fist test execution the database has to be initialised via command line script
Our PHPUnit integration requires a dedicated database and dataroot. Before the fist test execution the database has to be initialised via command line script:
  php admin/tool/phpunit/cli/util.php --drop; php admin/tool/phpunit/cli/util.php --install
  php admin/tool/phpunit/cli/util.php --drop; php admin/tool/phpunit/cli/util.php --install



Revision as of 21:23, 3 April 2012

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.

PHPUnit
Project state Work in progress
Tracker issue MDL-32323, MDL-32149, MDL-31857
Discussion see tracker issues
Assignee Petr Škoda (škoďák)

Moodle 2.3


Installation of PHPUnit support

PHPUnit is distributed as PEAR package, it is not part of Moodle installation.

Configuration of server before first test execution

Our PHPUnit integration requires a dedicated database and dataroot. Before the fist test execution the database has to be initialised via command line script:

php admin/tool/phpunit/cli/util.php --drop; php admin/tool/phpunit/cli/util.php --install

Test execution

PHPUnit tests are executed from the command line. PHP IDEs usually have integration options for PHPUnit.

All test suites

Individual tests

All tests in one directory

Writing new tests

Conversion of existing tests

See also