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

QueueFake

Extends

Implements

Uses

Properties

public

$queue Queue

The original queue manager.

Default: null
protected

$jobsToFake Illuminate\...\Collection

The job types that should be intercepted instead of pushed to the queue.

Default: null
protected

$jobsToBeQueued Illuminate\...\Collection

The job types that should be pushed to the queue and not intercepted.

Default: null
protected

$jobs array

All of the jobs that have been pushed.

Default: []

Methods

public

__construct ( $app , $jobsToFake , $queue ) : void

Create a new fake queue instance.

Parameters

public

except ( $jobsToBeQueued ) : $this

Specify the jobs that should be queued instead of faked.

Parameters

  • $jobsToBeQueued array|string
public

assertPushed ( $job , $callback ) : void

Assert if a job was pushed based on a truth-test callback.

Parameters

  • $job string|Closure
  • $callback callable|int|null
protected

assertPushedTimes ( $job , $times ) : void

Assert if a job was pushed a number of times.

Parameters

  • $job string
  • $times int
public

assertPushedOn ( $queue , $job , $callback ) : void

Assert if a job was pushed based on a truth-test callback.

Parameters

  • $queue string
  • $job string|Closure
  • $callback callable|null
public

assertPushedWithChain ( $job , $expectedChain , $callback ) : void

Assert if a job was pushed with chained jobs based on a truth-test callback.

Parameters

  • $job string
  • $expectedChain array
  • $callback callable|null
public

assertPushedWithoutChain ( $job , $callback ) : void

Assert if a job was pushed with an empty chain based on a truth-test callback.

Parameters

  • $job string
  • $callback callable|null
protected

assertPushedWithChainOfObjects ( $job , $expectedChain , $callback ) : void

Assert if a job was pushed with chained jobs based on a truth-test callback.

Parameters

  • $job string
  • $expectedChain array
  • $callback callable|null
protected

assertPushedWithChainOfClasses ( $job , $expectedChain , $callback ) : void

Assert if a job was pushed with chained jobs based on a truth-test callback.

Parameters

  • $job string
  • $expectedChain array
  • $callback callable|null
public

assertClosurePushed ( $callback ) : void

Assert if a closure was pushed based on a truth-test callback.

Parameters

  • $callback callable|int|null
public

assertClosureNotPushed ( $callback ) : void

Assert that a closure was not pushed based on a truth-test callback.

Parameters

  • $callback callable|null
protected

isChainOfObjects ( $chain ) : bool

Determine if the given chain is entirely composed of objects.

Parameters

  • $chain array
public

assertNotPushed ( $job , $callback ) : void

Determine if a job was pushed based on a truth-test callback.

Parameters

  • $job string|Closure
  • $callback callable|null
public

assertNothingPushed ( ) : void

Assert that no jobs were pushed.

public

pushed ( $job , $callback ) : Illuminate\...\Collection

Get all of the jobs matching a truth-test callback.

Parameters

  • $job string
  • $callback callable|null
public

hasPushed ( $job ) : bool

Determine if there are any stored jobs for a given class.

Parameters

  • $job string
public

connection ( $value ) : Queue

Resolve a queue connection instance.

Parameters

  • $value mixed
public

size ( $queue ) : int

Get the size of the queue.

Parameters

  • $queue string|null
public

push ( $job , $data , $queue ) : mixed

Push a new job onto the queue.

Parameters

  • $job string|object
  • $data mixed
  • $queue string|null
public

shouldFakeJob ( $job ) : bool

Determine if a job should be faked or actually dispatched.

Parameters

  • $job object
protected

shouldDispatchJob ( $job ) : bool

Determine if a job should be pushed to the queue instead of faked.

Parameters

  • $job object
public

pushRaw ( $payload , $queue , array $options ) : mixed

Push a raw payload onto the queue.

Parameters

  • $payload string
  • $queue string|null
  • $options array
public

later ( $delay , $job , $data , $queue ) : mixed

Push a new job onto the queue after (n) seconds.

Parameters

public

pushOn ( $queue , $job , $data ) : mixed

Push a new job onto the queue.

Parameters

  • $queue string
  • $job string|object
  • $data mixed
public

laterOn ( $queue , $delay , $job , $data ) : mixed

Push a new job onto a specific queue after (n) seconds.

Parameters

public

pop ( $queue ) : Job |null

Pop the next job off of the queue.

Parameters

  • $queue string|null
public

bulk ( $jobs , $data , $queue ) : mixed

Push an array of jobs onto the queue.

Parameters

  • $jobs array
  • $data mixed
  • $queue string|null
public

pushedJobs ( ) : array

Get the jobs that have been pushed.

public

getConnectionName ( ) : string

Get the connection name for the queue.

public

setConnectionName ( $name ) : $this

Set the connection name for the queue.

Parameters

  • $name string
public

__call ( $method , $parameters ) : mixed

Override the QueueManager to prevent circular dependency.

Parameters

  • $method string
  • $parameters array