ExpressionEngine 2024 Quarter 1 Review Quarter 1 Review
Allows for running PHPUnit within the ExpressionEngine sandbox.
Unit Tests is an Add-on for ExpressionEngine that allows developers to execute unit tests from the Command Line. EE Unit Tests uses PHPUnit 9 out of the box though, in theory, you should be able to use whatever version you want.
Unit Tests allows for running PHPUnit test suites from within the ExpressionEngine sandbox along with all its capabilities exposed for use within your tests. Write full Integration Tests, run of the mill Unit Tests, and anything you like using PHPUnit without having to mock your way to success.
EE Unit Tests is middleware between ExpressionEngine and your unit tests that you execute through ExpressionEngine’s Command Line tool (introduced in 6.1).
This will execute the Tests within the unit_tests
add-on.
php ./system/eecli.php tests:run -a your_addon_name
The below will display the available tests on the system
php ./system/eecli.php tests:list
PHPUnit unit tests will be automatically detected within any tests
directories stored in your add-on’s root directory. For example, unit_tests/tests
would be automatically picked up.
You can also configure a specific directory, relative to your add-on directory, within your addon.setup.php
file, using the tests
key.
The biggest problem is that there isn’t any Command Line Options Support for configuration. Too much. Not worth it. Instead, be sure to use a phpunit.xml
configuration file stored within your Tests root directory.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.