You are here

function PageTest::testBatchProgressMessages 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::testBatchProgressMessages()

Tests that the progress messages are correct.

File

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

Class

PageTest
Tests the content of the progress page.

Namespace

Drupal\system\Tests\Batch

Code

function testBatchProgressMessages() {

  // Go to the initial step only.
  $this->maximumMetaRefreshCount = 0;
  $this
    ->drupalGet('batch-test/test-title');
  $this
    ->assertRaw('<div class="progress__description">Initializing.<br />&nbsp;</div>', 'Initial progress message appears correctly.');
  $this
    ->assertNoRaw('&amp;nbsp;', 'Initial progress message is not double escaped.');

  // Now also go to the next step.
  $this->maximumMetaRefreshCount = 1;
  $this
    ->drupalGet('batch-test/test-title');
  $this
    ->assertRaw('<div class="progress__description">Completed 1 of 1.</div>', 'Progress message for second step appears correctly.');
}