Note
This example is based on the Dependency Installation and assumes that you plan to use the code coverage feature and have created the custom CLI file.
Project Structure
After the example installation, Reflex relies on a mapped file that does not yet exist. To align the project with the shared development metadata and the configuration used in the next section, create the structure shown below:
configs: Dir for all project configsreflex.php: Mapped example file
src: Code to testtests: All tests by categoryUnits: Unit tests
Default Test Runner
Reflex organizes tests by runner configuration. Add the following content
to the reflex.php file to use the default test runner:
// project root
// default runner requires absolute dirs
$root = dirname(__DIR__);
return [
"units" => [
"code" => "$root/src",
"tests" => "$root/tests/Units"
]
];
Now, pass the units ID to boot the default test runner, which searches for
custom tests in the absolute tests directory:
php reflex units
Since no custom tests exist yet, it reports zero executed tests and zero code coverage.