Cmfive Test Framework

Document Navigation

Cmfive Test Framework

Enable the Test Runner

This guide assumes Codeception is installed and Selenium configured with WebDriver in place, see: Installation.

The test framework is powerful and should not be enabled in live or production environments - it will allow unaware users to destroy data if running tests inappropriately! Make use of Cmfive scripts to manage and protect your database.

Enabling the test framework is simple. Edit the file:

cmfive-boilerplate/config.php

Update the ‘testrunner’ setting to ‘ENABLED’.

//========== TestRunner Configuration ==========================
//========== must be "ENABLED" to run ==========================
//========== "config" will pass through to CmfiveSite helper ===
Config::append("tests", array(
    "testrunner"  =>  "ENABLED",
    'config' => [ ]
));

The Cmfive test libraries do not need any extra entries to be added in the TestRunner ‘config’ array setting.

Make sure you refresh the Cmfive configuration cache, then run:

php cmfive-boilerplate/cmfive.php

You should see new menu items added to manage tests.