function BatchBuilderTest::testSetQueue

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.