class PHPUnit_Util_PHP_Windows extends PHPUnit_Util_PHP_Default (View source)

Windows utility for PHP sub-processes.

Reading from STDOUT or STDERR hangs forever on Windows if the output is too large.

Properties

protected Runtime $runtime from PHPUnit_Util_PHP
protected bool $stderrRedirection from PHPUnit_Util_PHP
protected string $stdin from PHPUnit_Util_PHP
protected string $args from PHPUnit_Util_PHP
protected array $env from PHPUnit_Util_PHP
protected int $timeout from PHPUnit_Util_PHP
protected string $tempFile from PHPUnit_Util_PHP_Default
protected $useTempFile

Methods

__construct()

Creates internal Runtime instance.

setUseStderrRedirection(bool $stderrRedirection)

Defines if should use STDERR redirection or not.

bool
useStderrRedirection()

Returns TRUE if uses STDERR redirection or FALSE if not.

setStdin(string $stdin)

Sets the input string to be sent via STDIN

string
getStdin()

Returns the input string to be sent via STDIN

setArgs(string $args)

Sets the string of arguments to pass to the php job

getArgs()

Returns the string of arguments to pass to the php job

setEnv(array $env)

Sets the array of environment variables to start the child process with

array
getEnv()

Returns the array of environment variables to start the child process with

setTimeout(int $timeout)

Sets the amount of seconds to wait before timing out

int
getTimeout()

Returns the amount of seconds to wait before timing out

factory()

No description

runTestJob(string $job, PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result)

Runs a single test in a separate PHP process.

string
getCommand(array $settings, string|null $file = null)

Returns the command based into the configurations.

array
runJob(string $job, array $settings = [])

Runs a single job (PHP code) using a separate PHP process.

string
settingsToParameters(array $settings)

No description

array
getHandles()

Returns an array of file handles to be used in place of pipes

array
runProcess(string $job, array $settings)

Handles creating the child process and returning the STDOUT and STDERR

process(resource $pipe, string $job)

No description

cleanup()

No description

Details

__construct()

Creates internal Runtime instance.

setUseStderrRedirection(bool $stderrRedirection)

Defines if should use STDERR redirection or not.

Then $stderrRedirection is TRUE, STDERR is redirected to STDOUT.

Parameters

bool $stderrRedirection

Exceptions

PHPUnit_Framework_Exception

bool useStderrRedirection()

Returns TRUE if uses STDERR redirection or FALSE if not.

Return Value

bool

setStdin(string $stdin)

Sets the input string to be sent via STDIN

Parameters

string $stdin

string getStdin()

Returns the input string to be sent via STDIN

Return Value

string

setArgs(string $args)

Sets the string of arguments to pass to the php job

Parameters

string $args

getArgs()

Returns the string of arguments to pass to the php job

setEnv(array $env)

Sets the array of environment variables to start the child process with

Parameters

array $env

array getEnv()

Returns the array of environment variables to start the child process with

Return Value

array

setTimeout(int $timeout)

Sets the amount of seconds to wait before timing out

Parameters

int $timeout

int getTimeout()

Returns the amount of seconds to wait before timing out

Return Value

int

static PHPUnit_Util_PHP factory()

Return Value

PHPUnit_Util_PHP

runTestJob(string $job, PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result)

Runs a single test in a separate PHP process.

Parameters

string $job
PHPUnit_Framework_Test $test
PHPUnit_Framework_TestResult $result

Exceptions

PHPUnit_Framework_Exception

string getCommand(array $settings, string|null $file = null)

Returns the command based into the configurations.

Parameters

array $settings
string|null $file

Return Value

string

array runJob(string $job, array $settings = [])

Runs a single job (PHP code) using a separate PHP process.

Parameters

string $job
array $settings

Return Value

array

Exceptions

PHPUnit_Framework_Exception

protected string settingsToParameters(array $settings)

Parameters

array $settings

Return Value

string

protected array getHandles()

Returns an array of file handles to be used in place of pipes

Return Value

array

protected array runProcess(string $job, array $settings)

Handles creating the child process and returning the STDOUT and STDERR

Parameters

string $job
array $settings

Return Value

array

Exceptions

PHPUnit_Framework_Exception

protected process(resource $pipe, string $job)

Parameters

resource $pipe
string $job

Exceptions

PHPUnit_Framework_Exception

protected cleanup()