You are here

public function ProcessorTest::retryJobProvider in Advanced Queue 8

Data provider for ::testRetry.

Return value

array A list of testRetry function arguments.

File

tests/src/Kernel/ProcessorTest.php, line 146

Class

ProcessorTest
@coversDefaultClass \Drupal\advancedqueue\Processor @group advancedqueue

Namespace

Drupal\Tests\advancedqueue\Kernel

Code

public function retryJobProvider() {

  // The first job has job-type-level retry parameters.
  // The second job has result-level retry parameters.
  $first_job = Job::create('retry', [
    'test' => '1',
  ]);
  $second_job = Job::create('flexible', [
    'expected_state' => Job::STATE_FAILURE,
    'expected_message' => '',
    'max_retries' => '1',
    'retry_delay' => 1,
  ]);
  return [
    [
      $first_job,
    ],
    [
      $second_job,
    ],
  ];
}