Step 1: Unit testing

Innomatic supports unit testing with PHPUnit and provides a preconfigured phpunit.xml configuration file.

Applications can add PHPUnit tests using the unittest component.

Test files should be added inside a tests subdirectory inside the tested class folder:

innomatic/core/classes/innomatic/core/InnomaticSettings.php
innomatic/core/classes/innomatic/core/tests/InnomaticSettingsTest.php

Example definition in application.xml file:

<class name="innomatic/core/InnomaticSettings.php" />
<unittest name="innomatic/core/tests/InnomaticSettingsTest.php" />

To test Innomatic code, PHPUnit must be launched inside the “innomatic” directory of an installed Innomatic instance:

cd innomatic
phpunit 

Limitations

Innomatic applications to be tested must be deployed inside a working Innomatic installation before running the test suite (you cannot run the tests inside the sources folder).

Please note that as of Innomatic 6.4.x unit testing support is experimental; there are no such facilities like automatic generation of test databases, etc.

Next: Part 7: Debugging Innomatic applications