class Illuminate / Process / Factory
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

Factory

Uses

Properties

protected

$recording bool

Indicates if the process factory has faked process handlers.

Default: false
protected

$recorded array

All of the recorded processes.

Default: []
protected

$fakeHandlers array

The registered fake handler callbacks.

Default: []
protected

$preventStrayProcesses bool

Indicates that an exception should be thrown if any process is not faked.

Default: false

Methods

public

result ( $output , $errorOutput , int $exitCode ) : FakeProcessResult

Create a new fake process response for testing purposes.

Parameters

  • $output array|string
  • $errorOutput array|string
  • $exitCode int
public

describe ( ) : FakeProcessDescription

Begin describing a fake process lifecycle.

public

sequence ( array $processes ) : FakeProcessSequence

Begin describing a fake process sequence.

Parameters

  • $processes array
public

fake ( $callback ) : $this

Indicate that the process factory should fake processes.

Parameters

public

isRecording ( ) : bool

Determine if the process factory has fake process handlers and is recording processes.

public

recordIfRecording ( PendingProcess $process , ProcessResult $result ) : $this

Record the given process if processes should be recorded.

Parameters

public

record ( PendingProcess $process , ProcessResult $result ) : $this

Record the given process.

Parameters

public

preventStrayProcesses ( bool $prevent ) : $this

Indicate that an exception should be thrown if any process is not faked.

Parameters

  • $prevent bool
public

preventingStrayProcesses ( ) : bool

Determine if stray processes are being prevented.

public

assertRan ( $callback ) : $this

Assert that a process was recorded matching a given truth test.

Parameters

public

assertRanTimes ( $callback , int $times ) : $this

Assert that a process was recorded a given number of times matching a given truth test.

Parameters

public

assertNotRan ( $callback ) : $this

Assert that a process was not recorded matching a given truth test.

Parameters

public

assertDidntRun ( $callback ) : $this

Assert that a process was not recorded matching a given truth test.

Parameters

public

assertNothingRan ( ) : $this

Assert that no processes were recorded.

public

pool ( callable $callback ) : Pool

Start defining a pool of processes.

Parameters

  • $callback callable
public

pipe ( $callback , callable $output ) : ProcessResult

Start defining a series of piped processes.

Parameters

  • $callback callable|array
public

concurrently ( callable $callback , callable $output ) : ProcessPoolResults

Run a pool of processes and wait for them to finish executing.

Parameters

  • $callback callable
  • $output callable|null
public

newPendingProcess ( ) : PendingProcess

Create a new pending process associated with this factory.

public

__call ( $method , $parameters ) : mixed

Dynamically proxy methods to a new pending process instance.

Parameters

  • $method string
  • $parameters array