Documentation

ProcessTest extends TestCase
in package

Tags
author

Robert Schönthal seroscho@googlemail.com

Table of Contents

Properties

$notEnhancedSigchild  : mixed
$phpBin  : mixed
$process  : mixed
$sigchild  : mixed

Methods

chainedCommandsOutputProvider()  : mixed
pipesCodeProvider()  : mixed
provideEscapeArgument()  : mixed
provideIncrementalOutput()  : mixed
provideInputValues()  : mixed
provideInvalidInputValues()  : mixed
provideMethodsThatNeedARunningProcess()  : mixed
provideMethodsThatNeedATerminatedProcess()  : mixed
provideOutputFetchingMethods()  : mixed
provideVariousIncrementals()  : mixed
provideWrongSignal()  : mixed
responsesCodeProvider()  : mixed
setUpBeforeClass()  : mixed
testAllOutputIsActuallyReadOnTermination()  : mixed
testCallbackIsExecutedForOutput()  : mixed
testCallbackIsExecutedForOutputWheneverOutputIsDisabled()  : mixed
testCallbacksAreExecutedWithStart()  : mixed
testChainedCommandsOutput()  : mixed
testChainedProcesses()  : mixed
testCheckTimeoutOnNonStartedProcess()  : mixed
testCheckTimeoutOnStartedProcess()  : mixed
testCheckTimeoutOnTerminatedProcess()  : mixed
testDisableOutputDisablesTheOutput()  : mixed
testDisableOutputWhileIdleTimeoutIsSet()  : mixed
testDisableOutputWhileRunningThrowsException()  : mixed
testEnableOrDisableOutputAfterRunDoesNotThrowException()  : mixed
testEnableOutputWhileRunningThrowsException()  : mixed
testEnvArgument()  : mixed
testEnvBackupDoesNotDeleteExistingVars()  : mixed
testEnvIsInherited()  : mixed
testEscapeArgument()  : mixed
testEscapeArgumentWhenInheritEnvDisabled()  : mixed
testExitCodeCommandFailed()  : mixed
testExitCodeIsAvailableAfterSignal()  : mixed
testExitCodeText()  : mixed
testExitCodeTextIsNullWhenExitCodeIsNull()  : mixed
testFloatAndNullTimeout()  : mixed
testFlushErrorOutput()  : mixed
testFlushOutput()  : mixed
testGetCommandLine()  : mixed
testGetErrorOutput()  : mixed
testGetExitCode()  : mixed
testGetExitCodeIsNullOnStart()  : mixed
testGetExitCodeIsNullOnWhenStartingAgain()  : mixed
testGetOutput()  : mixed
testGetOutputWhileDisabled()  : mixed
testGetPid()  : mixed
testGetPidIsNullAfterRun()  : mixed
testGetPidIsNullBeforeStart()  : mixed
testIdleTimeout()  : mixed
testIdleTimeoutNotExceededWhenOutputIsSent()  : mixed
testIncrementalOutput()  : mixed
testIncrementalOutputDoesNotRequireAnotherCall()  : mixed
testInheritEnvDisabled()  : mixed
testInputStreamOnEmpty()  : mixed
testInputStreamWithCallable()  : mixed
testInputStreamWithGenerator()  : mixed
testInvalidInput()  : mixed
testIsNotSuccessful()  : mixed
testIsSuccessful()  : mixed
testIsSuccessfulOnlyAfterTerminated()  : mixed
testIterateOverProcessWithTimeout()  : mixed
testIteratorInput()  : mixed
testIteratorOutput()  : mixed
testKillSignalTerminatesProcessCleanly()  : mixed
testLiveStreamAsInput()  : mixed
testMethodsThatNeedARunningProcess()  : mixed
testMethodsThatNeedATerminatedProcess()  : mixed
testMustRun()  : mixed
testMustRunThrowsException()  : mixed
testNegativeTimeoutFromConstructor()  : mixed
testNegativeTimeoutFromSetter()  : mixed
testNonBlockingNorClearingIteratorOutput()  : mixed
testProcessIsNotSignaled()  : mixed
testProcessIsSignaledIfStopped()  : mixed
testProcessPipes()  : mixed
tests results from sub processes.
testProcessResponses()  : mixed
tests results from sub processes.
testProcessThrowsExceptionWhenExternallySignaled()  : mixed
testProcessWithoutTermSignal()  : mixed
testPTYCommand()  : mixed
testRawCommandLine()  : mixed
testRestart()  : mixed
testRunProcessWithTimeout()  : mixed
testSetBadEnv()  : mixed
testSetIdleTimeoutWhileOutputIsDisabled()  : mixed
testSetInputWhileRunningThrowsAnException()  : mixed
testSetNullIdleTimeoutWhileOutputIsDisabled()  : mixed
testSetStreamAsInput()  : mixed
testSignal()  : mixed
testSignalProcessNotRunning()  : mixed
testSimpleInputStream()  : mixed
testStartAfterATimeout()  : mixed
testStartIsNonBlocking()  : mixed
testStatus()  : mixed
testStop()  : mixed
testStopTerminatesProcessCleanly()  : mixed
testStopWithTimeoutIsActuallyWorking()  : mixed
testSuccessfulMustRunHasCorrectExitCode()  : mixed
testTermSignalTerminatesProcessCleanly()  : mixed
testThatProcessDoesNotThrowWarningDuringRun()  : mixed
testTTYCommand()  : mixed
testTTYCommandExitCode()  : mixed
testTTYInWindowsEnvironment()  : mixed
testUpdateStatus()  : mixed
testValidInput()  : mixed
testWrongSignal()  : mixed
testZeroAsOutput()  : mixed
tearDown()  : mixed
getProcess()  : Process
getProcessForCode()  : Process
skipIfNotEnhancedSigchild()  : mixed

Properties

$notEnhancedSigchild

private static mixed $notEnhancedSigchild = false

Methods

chainedCommandsOutputProvider()

public chainedCommandsOutputProvider() : mixed

pipesCodeProvider()

public pipesCodeProvider() : mixed

provideEscapeArgument()

public provideEscapeArgument() : mixed

provideIncrementalOutput()

public provideIncrementalOutput() : mixed

provideInputValues()

public provideInputValues() : mixed

provideInvalidInputValues()

public provideInvalidInputValues() : mixed

provideMethodsThatNeedARunningProcess()

public provideMethodsThatNeedARunningProcess() : mixed

provideMethodsThatNeedATerminatedProcess()

public provideMethodsThatNeedATerminatedProcess() : mixed

provideOutputFetchingMethods()

public provideOutputFetchingMethods() : mixed

provideVariousIncrementals()

public provideVariousIncrementals() : mixed

provideWrongSignal()

public provideWrongSignal() : mixed

responsesCodeProvider()

public responsesCodeProvider() : mixed

setUpBeforeClass()

public static setUpBeforeClass() : mixed

testAllOutputIsActuallyReadOnTermination()

public testAllOutputIsActuallyReadOnTermination() : mixed

testCallbackIsExecutedForOutput()

public testCallbackIsExecutedForOutput() : mixed

testCallbackIsExecutedForOutputWheneverOutputIsDisabled()

public testCallbackIsExecutedForOutputWheneverOutputIsDisabled() : mixed

testCallbacksAreExecutedWithStart()

public testCallbacksAreExecutedWithStart() : mixed

testChainedCommandsOutput()

public testChainedCommandsOutput(mixed $expected, mixed $operator, mixed $input) : mixed
Parameters
$expected : mixed
$operator : mixed
$input : mixed
Tags
dataProvider

chainedCommandsOutputProvider

testChainedProcesses()

public testChainedProcesses() : mixed

testCheckTimeoutOnNonStartedProcess()

public testCheckTimeoutOnNonStartedProcess() : mixed

testCheckTimeoutOnStartedProcess()

public testCheckTimeoutOnStartedProcess() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\ProcessTimedOutException

expectedExceptionMessage

exceeded the timeout of 0.1 seconds.

testCheckTimeoutOnTerminatedProcess()

public testCheckTimeoutOnTerminatedProcess() : mixed

testDisableOutputDisablesTheOutput()

public testDisableOutputDisablesTheOutput() : mixed

testDisableOutputWhileIdleTimeoutIsSet()

public testDisableOutputWhileIdleTimeoutIsSet() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\LogicException

expectedExceptionMessage

Output can not be disabled while an idle timeout is set.

testDisableOutputWhileRunningThrowsException()

public testDisableOutputWhileRunningThrowsException() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\RuntimeException

expectedExceptionMessage

Disabling output while the process is running is not possible.

testEnableOrDisableOutputAfterRunDoesNotThrowException()

public testEnableOrDisableOutputAfterRunDoesNotThrowException() : mixed

testEnableOutputWhileRunningThrowsException()

public testEnableOutputWhileRunningThrowsException() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\RuntimeException

expectedExceptionMessage

Enabling output while the process is running is not possible.

testEnvArgument()

public testEnvArgument() : mixed

testEnvBackupDoesNotDeleteExistingVars()

public testEnvBackupDoesNotDeleteExistingVars() : mixed

testEnvIsInherited()

public testEnvIsInherited() : mixed

testEscapeArgument()

public testEscapeArgument(mixed $arg) : mixed
Parameters
$arg : mixed
Tags
dataProvider

provideEscapeArgument

testEscapeArgumentWhenInheritEnvDisabled()

public testEscapeArgumentWhenInheritEnvDisabled(mixed $arg) : mixed
Parameters
$arg : mixed
Tags
dataProvider

provideEscapeArgument

group

legacy

testExitCodeCommandFailed()

public testExitCodeCommandFailed() : mixed

testExitCodeIsAvailableAfterSignal()

public testExitCodeIsAvailableAfterSignal() : mixed
Tags
requires

extension pcntl

testExitCodeText()

public testExitCodeText() : mixed

testExitCodeTextIsNullWhenExitCodeIsNull()

public testExitCodeTextIsNullWhenExitCodeIsNull() : mixed

testFloatAndNullTimeout()

public testFloatAndNullTimeout() : mixed

testFlushErrorOutput()

public testFlushErrorOutput() : mixed

testGetCommandLine()

public testGetCommandLine() : mixed

testGetErrorOutput()

public testGetErrorOutput() : mixed

testGetExitCodeIsNullOnStart()

public testGetExitCodeIsNullOnStart() : mixed

testGetExitCodeIsNullOnWhenStartingAgain()

public testGetExitCodeIsNullOnWhenStartingAgain() : mixed

testGetOutputWhileDisabled()

public testGetOutputWhileDisabled(mixed $fetchMethod) : mixed
Parameters
$fetchMethod : mixed
Tags
dataProvider

provideOutputFetchingMethods

expectedException

\Symfony\Component\Process\Exception\LogicException

expectedExceptionMessage

Output has been disabled.

testGetPidIsNullAfterRun()

public testGetPidIsNullAfterRun() : mixed

testGetPidIsNullBeforeStart()

public testGetPidIsNullBeforeStart() : mixed

testIdleTimeoutNotExceededWhenOutputIsSent()

public testIdleTimeoutNotExceededWhenOutputIsSent() : mixed

testIncrementalOutput()

public testIncrementalOutput(mixed $getOutput, mixed $getIncrementalOutput, mixed $uri) : mixed
Parameters
$getOutput : mixed
$getIncrementalOutput : mixed
$uri : mixed
Tags
dataProvider

provideIncrementalOutput

testIncrementalOutputDoesNotRequireAnotherCall()

public testIncrementalOutputDoesNotRequireAnotherCall(mixed $stream, mixed $method) : mixed
Parameters
$stream : mixed
$method : mixed
Tags
dataProvider

provideVariousIncrementals

testInheritEnvDisabled()

public testInheritEnvDisabled() : mixed
Tags
group

legacy

testInputStreamOnEmpty()

public testInputStreamOnEmpty() : mixed

testInputStreamWithCallable()

public testInputStreamWithCallable() : mixed

testInputStreamWithGenerator()

public testInputStreamWithGenerator() : mixed

testInvalidInput()

public testInvalidInput(mixed $value) : mixed
Parameters
$value : mixed
Tags
dataProvider

provideInvalidInputValues

expectedException

\Symfony\Component\Process\Exception\InvalidArgumentException

expectedExceptionMessage

Symfony\Component\Process\Process::setInput only accepts strings, Traversable objects or stream resources.

testIsNotSuccessful()

public testIsNotSuccessful() : mixed

testIsSuccessful()

public testIsSuccessful() : mixed

testIsSuccessfulOnlyAfterTerminated()

public testIsSuccessfulOnlyAfterTerminated() : mixed

testIterateOverProcessWithTimeout()

public testIterateOverProcessWithTimeout() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\ProcessTimedOutException

expectedExceptionMessage

exceeded the timeout of 0.1 seconds.

testIteratorInput()

public testIteratorInput() : mixed

testIteratorOutput()

public testIteratorOutput() : mixed

testKillSignalTerminatesProcessCleanly()

public testKillSignalTerminatesProcessCleanly() : mixed

testLiveStreamAsInput()

public testLiveStreamAsInput() : mixed

testMethodsThatNeedARunningProcess()

public testMethodsThatNeedARunningProcess(mixed $method) : mixed
Parameters
$method : mixed
Tags
dataProvider

provideMethodsThatNeedARunningProcess

testMethodsThatNeedATerminatedProcess()

public testMethodsThatNeedATerminatedProcess(mixed $method) : mixed
Parameters
$method : mixed
Tags
dataProvider

provideMethodsThatNeedATerminatedProcess

expectedException

\Symfony\Component\Process\Exception\LogicException

expectedExceptionMessage

Process must be terminated before calling

testMustRunThrowsException()

public testMustRunThrowsException() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\ProcessFailedException

testNegativeTimeoutFromConstructor()

public testNegativeTimeoutFromConstructor() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\InvalidArgumentException

testNegativeTimeoutFromSetter()

public testNegativeTimeoutFromSetter() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\InvalidArgumentException

testNonBlockingNorClearingIteratorOutput()

public testNonBlockingNorClearingIteratorOutput() : mixed

testProcessIsNotSignaled()

public testProcessIsNotSignaled() : mixed

testProcessIsSignaledIfStopped()

public testProcessIsSignaledIfStopped() : mixed

testProcessPipes()

tests results from sub processes.

public testProcessPipes(mixed $code, mixed $size) : mixed
Parameters
$code : mixed
$size : mixed
Tags
dataProvider

pipesCodeProvider

testProcessResponses()

tests results from sub processes.

public testProcessResponses(mixed $expected, mixed $getter, mixed $code) : mixed
Parameters
$expected : mixed
$getter : mixed
$code : mixed
Tags
dataProvider

responsesCodeProvider

testProcessThrowsExceptionWhenExternallySignaled()

public testProcessThrowsExceptionWhenExternallySignaled() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\RuntimeException

expectedExceptionMessage

The process has been signaled

testProcessWithoutTermSignal()

public testProcessWithoutTermSignal() : mixed

testRawCommandLine()

public testRawCommandLine() : mixed

testRunProcessWithTimeout()

public testRunProcessWithTimeout() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\ProcessTimedOutException

expectedExceptionMessage

exceeded the timeout of 0.1 seconds.

testSetIdleTimeoutWhileOutputIsDisabled()

public testSetIdleTimeoutWhileOutputIsDisabled() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\LogicException

expectedExceptionMessage

timeout can not be set while the output is disabled.

testSetInputWhileRunningThrowsAnException()

public testSetInputWhileRunningThrowsAnException() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\LogicException

expectedExceptionMessage

Input can not be set while the process is running.

testSetNullIdleTimeoutWhileOutputIsDisabled()

public testSetNullIdleTimeoutWhileOutputIsDisabled() : mixed

testSetStreamAsInput()

public testSetStreamAsInput(mixed $code, mixed $size) : mixed
Parameters
$code : mixed
$size : mixed
Tags
dataProvider

pipesCodeProvider

testSignal()

public testSignal() : mixed
Tags
requires

extension pcntl

testSignalProcessNotRunning()

public testSignalProcessNotRunning() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\LogicException

expectedExceptionMessage

Can not send signal on a non running process.

testSimpleInputStream()

public testSimpleInputStream() : mixed

testStartAfterATimeout()

public testStartAfterATimeout() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\ProcessTimedOutException

expectedExceptionMessage

exceeded the timeout of 0.1 seconds.

testStartIsNonBlocking()

public testStartIsNonBlocking() : mixed

testStopTerminatesProcessCleanly()

public testStopTerminatesProcessCleanly() : mixed

testStopWithTimeoutIsActuallyWorking()

public testStopWithTimeoutIsActuallyWorking() : mixed
Tags
requires

extension pcntl

testSuccessfulMustRunHasCorrectExitCode()

public testSuccessfulMustRunHasCorrectExitCode() : mixed

testTermSignalTerminatesProcessCleanly()

public testTermSignalTerminatesProcessCleanly() : mixed

testThatProcessDoesNotThrowWarningDuringRun()

public testThatProcessDoesNotThrowWarningDuringRun() : mixed

testTTYCommand()

public testTTYCommand() : mixed
Tags
group

tty

testTTYCommandExitCode()

public testTTYCommandExitCode() : mixed
Tags
group

tty

testTTYInWindowsEnvironment()

public testTTYInWindowsEnvironment() : mixed
Tags
expectedException

\Symfony\Component\Process\Exception\RuntimeException

expectedExceptionMessage

TTY mode is not supported on Windows platform.

testUpdateStatus()

public testUpdateStatus() : mixed

testValidInput()

public testValidInput(mixed $expected, mixed $value) : mixed
Parameters
$expected : mixed
$value : mixed
Tags
dataProvider

provideInputValues

testWrongSignal()

public testWrongSignal(mixed $signal) : mixed
Parameters
$signal : mixed
Tags
dataProvider

provideWrongSignal

expectedException

\Symfony\Component\Process\Exception\RuntimeException

testZeroAsOutput()

public testZeroAsOutput() : mixed

getProcess()

private getProcess(string $commandline[, null|string $cwd = null ][, null|array<string|int, mixed> $env = null ][, null|string $input = null ][, int $timeout = 60 ]) : Process
Parameters
$commandline : string
$cwd : null|string = null
$env : null|array<string|int, mixed> = null
$input : null|string = null
$timeout : int = 60
Return values
Process

getProcessForCode()

private getProcessForCode(mixed $code[, mixed $cwd = null ][, array<string|int, mixed> $env = null ][, mixed $input = null ][, mixed $timeout = 60 ]) : Process
Parameters
$code : mixed
$cwd : mixed = null
$env : array<string|int, mixed> = null
$input : mixed = null
$timeout : mixed = 60
Return values
Process

skipIfNotEnhancedSigchild()

private skipIfNotEnhancedSigchild([mixed $expectException = true ]) : mixed
Parameters
$expectException : mixed = true

        
On this page

Search results