You are here

function PageTest::testBatchProgressPageTitle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Batch/PageTest.php \Drupal\system\Tests\Batch\PageTest::testBatchProgressPageTitle()

Tests that the batch API progress page shows the title correctly.

File

core/modules/system/src/Tests/Batch/PageTest.php, line 54
Contains \Drupal\system\Tests\Batch\PageTest.

Class

PageTest
Tests the content of the progress page.

Namespace

Drupal\system\Tests\Batch

Code

function testBatchProgressPageTitle() {

  // Visit an administrative page that runs a test batch, and check that the
  // title shown during batch execution (which the batch callback function
  // saved as a variable) matches the theme used on the administrative page.
  $this
    ->drupalGet('batch-test/test-title');

  // The stack should contain the title shown on the progress page.
  $this
    ->assertEqual(batch_test_stack(), [
    'Batch Test',
  ], 'The batch title is shown on the batch page.');
  $this
    ->assertText('Redirection successful.', 'Redirection after batch execution is correct.');
}