function BatchBuilderTest::testSetTitle

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php \Drupal\Tests\Core\Batch\BatchBuilderTest::testSetTitle()
  2. 8.9.x core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php \Drupal\Tests\Core\Batch\BatchBuilderTest::testSetTitle()
  3. 11.x core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php \Drupal\Tests\Core\Batch\BatchBuilderTest::testSetTitle()

Tests setTitle().

@covers ::setTitle

File

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

Class

BatchBuilderTest
Tests for the batch builder class.

Namespace

Drupal\Tests\Core\Batch

Code

public function testSetTitle() : void {
    $batch = (new BatchBuilder())->setTitle(new TranslatableMarkup('New Title'))
        ->toArray();
    $this->assertEquals(new TranslatableMarkup('New Title'), $batch['title']);
}

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