class Illuminate / Support / Testing / Fakes / BatchFake

BatchFake

Extends

Properties

public

$added array

The jobs that have been added to the batch.

Default: []
public

$deleted bool

Indicates if the batch has been deleted.

Default: false

Methods

public

__construct ( string $id , string $name , int $totalJobs , int $pendingJobs , int $failedJobs , array $failedJobIds , array $options , Carbon\CarbonImmutable $createdAt , Carbon\CarbonImmutable $cancelledAt , Carbon\CarbonImmutable $finishedAt ) : void

Create a new batch instance.

Parameters

  • $id string
  • $name string
  • $totalJobs int
  • $pendingJobs int
  • $failedJobs int
  • $failedJobIds array
  • $options array
  • $createdAt Carbon\CarbonImmutable
  • $cancelledAt Carbon\CarbonImmutable|null
  • $finishedAt Carbon\CarbonImmutable|null
public

fresh ( ) : self

Get a fresh instance of the batch represented by this ID.

public

add ( $jobs ) : self

Add additional jobs to the batch.

Parameters

  • $jobs Illuminate\...\Enumerable|object|array
public

recordSuccessfulJob ( string $jobId ) : void

Record that a job within the batch finished successfully, executing any callbacks if necessary.

Parameters

  • $jobId string
public

decrementPendingJobs ( string $jobId ) : UpdatedBatchJobCounts

Decrement the pending jobs for the batch.

Parameters

  • $jobId string
public

recordFailedJob ( string $jobId , $e ) : void

Record that a job within the batch failed to finish successfully, executing any callbacks if necessary.

Parameters

public

incrementFailedJobs ( string $jobId ) : UpdatedBatchJobCounts

Increment the failed jobs for the batch.

Parameters

  • $jobId string
public

cancel ( ) : void

Cancel the batch.

public

delete ( ) : void

Delete the batch from storage.

public

deleted ( ) : bool

Determine if the batch has been deleted.