You are here

public function BatchBuilderTest::testSetTitle in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php \Drupal\Tests\Core\Batch\BatchBuilderTest::testSetTitle()
  2. 10 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 52

Class

BatchBuilderTest
Tests for the batch builder class.

Namespace

Drupal\Tests\Core\Batch

Code

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