- Do a normal install on the machine you wish to test on.
phpunit.xmlfile in your config directory. It should contain the following settings:
Code Block language xml title phpunit.xml
<?xml version="1.0" encoding="UTF-8"?> <rogo> <db_database>phpunit_database_schema_name</db_database> <db_user>username</db_user> <db_password>password</db_password> <data>path_to_user_data_directory</data> <db_engine>The database table type you wish to run Rogo, it will default to the one your main Rogo site is installed on (optional)</db_engine> <db_help_engine>The database table type you wish to run the help system on, it will default to the one your main Rogo site is installed on (optional)</db_help_engine> </rogo>
- Run the following script from the command line: testing/unittest/cli/init.php
- Run the following command to run the test suite:
vendor/bin/phpunit -c testing/unittest/config/phpunit.xml
If you are developing a patch that makes changes to the Rogo database you will need to reinitialise your unit test database with the --clean option to ensure that it is in place.
Creating a unit test
All unit tests should be placed in the
testing/unittest/tests directory of rogo.