final class RunnerConfig
Public API: explicitly declared with @visibility public.

How a named runner executes: its extension, command, working directory and timeout.

Describing a PHPUnit runnerdoctest
$config = new \Requirements\Test\RunnerConfig('phpunit', ['php', 'vendor/bin/phpunit'], '/project');
    [$config->extension, $config->command, $config->directory, $config->timeout] // => ['phpunit', ['php', 'vendor/bin/phpunit'], '/project', 60.0]
Reading a runner entry of requirements.yamldoctest
$config = \Requirements\Test\RunnerConfig::from(['extension' => 'behat', 'command' => ['php', 'vendor/bin/behat'], 'cwd' => 'tests', 'timeout' => 5], '/project');
    [$config->directory, $config->timeout] // => ['/project/tests', 5.0]

Properties§

public string $extension
public non-empty-list<string> $command
public string $directory
public float $timeout = 60.0

Methods§

public function __construct(
    public string $extension,
    public non-empty-list<string> $command,
    public string $directory,
    public float $timeout = 60.0,
)

Parameters

$extensionstringThe registered runner extension name
$commandnon-empty-list<string>The command and its arguments, run without a shell
$directorystringThe absolute working directory
$timeoutfloatThe positive timeout in seconds
public static function from(mixed $value, string $directory): self

Reads a runner entry of the configuration.

Parameters

$valuemixedThe decoded runner entry
$directorystringThe configuration directory that a relative cwd resolves against

Returns

self The runner configuration

Throws

InvalidInputException When the entry has unknown fields, no command or a nonpositive timeout
Test cases 7
Called from 1
Calls 10

Test cases 47§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 8
Other tests reaching this symbol 39

Relations§

Static calls 1
Type declarations 4