You are here

public function BatchBuilderTest::testSetQueue in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php \Drupal\Tests\Core\Batch\BatchBuilderTest::testSetQueue()
  2. 10 core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php \Drupal\Tests\Core\Batch\BatchBuilderTest::testSetQueue()

Tests setQueue().

@covers ::setQueue

File

core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php, line 170

Class

BatchBuilderTest
Tests for the batch builder class.

Namespace

Drupal\Tests\Core\Batch

Code

public function testSetQueue() {
  $batch = (new BatchBuilder())
    ->setQueue('BatchName', '\\Drupal\\Core\\Queue\\Batch')
    ->toArray();
  $this
    ->assertEquals([
    'name' => 'BatchName',
    'class' => '\\Drupal\\Core\\Queue\\Batch',
  ], $batch['queue'], 'Batch queue has been set.');
}