Gizzmo Gizzmo - 2 years ago 147
PHP Question

How do you run a codeception test from within a php script?

I do not want to run a codeception test from the CLI:

php <pathToCodeCeption>/codecept run

I want to run it inside a PHP script:


$codeCeptionRunner = /* What to do here*/;

Does anyone has an idea how to accomplish this task?

Answer Source

Start with this snippet:

require_once '/path/to/codeception/autoload.php';

$Codecept = new \Codeception\Codecept(array(
    'steps' => true,
    'verbosity' => 1,
    // some other options (see Codeception docs/sources)


and then dig into Codeception sources. It is really clear and easy to understand.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download