We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Add-Ons
default app icon

Unit Tests

By mithra62
Integrations Utilities
Free

Description

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.

How It Works

EE Unit Tests is middleware between ExpressionEngine and your unit tests that you execute through ExpressionEngine’s Command Line tool (introduced in 6.1).

Example Command

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

Creating Unit Tests for Add-ons

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.

Limitations

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.

Information
Version 1.0.0
Last Update one year ago
Compatibility EE 7, 6
License Commercial
Links
  • Support
Free
ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.