Gizzmo Gizzmo - 4 months ago 28x
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?


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.