Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Current »

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

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

cd innomatic
phpunit

The same applies for Innomatic applications, that must be deployed inside a working Innomatic installation before running the test suite (you cannot run the tests inside the sources folder).

Developing unit tests

Applications can add PHPUnit tests using the unittest component.

Test files should be added inside a tests subdirectory inside the tested class folder, e.g.:

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" />
  • No labels