Running Aspen Unit Tests

Setting up to run unit tests

Unit tests depend on having the unit_tests site setup on your machine. That can be done with the following proceedure:

  1. Create a templates directory within the install directory.
  2. In the install directory, copy the unit_tests.ini to templates/unit_tests_local.ini.
  3. Modify the copied file to include your local MySQL username and password.
  4. From the command line navigate to the install directory.
  5. Run php createSite.php templates/unit_tests_local.ini 
  6. Complete setup per instructions.

PHP Unit Tests

To run the unit tests for PHP from PhpStorm:

  1. Navigate to tests/phpunit
  2. Right click on phpunit.xml
  3. Select Run 'phpunit.xml (PHPUnit)'
  4. To run with debugging, select Debug 'phpunit.xml (PHPUnit)'

Java Unit Tests

To run the unit tests for Java from IntelliJ IDEA:

  1. Navigate to reindexer/tests
  2. Right click on the test you wish to run
  3. Select Run '<name of test>'
  4. To run with debugging, select Debug '<name of test>'