search hotlink icon profile hotlink icon
Re Public | 1.1.x - 1.x.x

On This Page

Runners are invokable components responsible for executing tests and can be added or removed through config files. When configuring a runner, you define an individual test group under an explicitly invokable ID (<runner-id>):

                return [
    "<runner-id>" => [
        "runner" => "<implementation>"
    ]
]
            

Note

Reflex organizes tests by runner configuration.

Test Runner

The test runner discovers and executes custom tests and optionally measures code coverage when configured:

                [
    "runner" => \Valvoid\Reflex\Runners\Test\Runner::class,
    "tests" =>  "<path>",
    "code" => "<path>",
    "ignore" => "<path>"
]
            

Note

This runner is enabled by default. If no runner is specified in the config, Reflex will use it automatically.

Custom Test Path

To configure which test locations the runner should process, the required tests entry must map to an absolute file or directory path, or an array of paths. The runner processes the paths in order from top to bottom, ignoring duplicates so each test is executed only once.

                [
    "tests" =>  [
        "$root/tests/CustomTest.php", // file
        "$root/tests" // dir
    ]
]
            

Code Coverage Path

By default, code coverage is disabled. If the optional code entry is defined, the test runner will enable coverage measurement for the specified paths. Similar to the previous section, paths must be absolute and may be provided as a single path or an array of paths.

Excludable Path

Some paths defined in the previous sections may contain unprocessable files or directories that should be excluded. To do so, you can define the optional ignore entry. Similar to the previous sections, paths must be absolute and may be provided as a single path or an array of paths.