Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Do a normal install on the machine you wish to test on. 
  2. Create a phpunit.xml file in your config directory. It should contain the following settings:

    Code Block
    languagexml
    titlephpunit.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>
    


  3. Run the following script from the command line: testing/unittest/cli/init.php

...

  1. Run the following command to run the test suite: vendor/bin/phpunit -c testing/unittest/config/phpunit.xml
Info

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.

Code Block
php testing/unittest/cli/init.php --clean


Creating a unit test

All unit tests should be placed in the testing/unittest/tests directory of rogo.

...