Same filename in this branch
- 10 core/modules/system/tests/src/Functional/Batch/PageTest.php
- 10 core/modules/views/tests/src/Unit/Plugin/display/PageTest.php
Same filename and directory in other branches
- 8.9.x core/modules/system/tests/src/Functional/Batch/PageTest.php
- 9 core/modules/system/tests/src/Functional/Batch/PageTest.php
Namespace
Drupal\Tests\system\Functional\Batch
File
core/modules/system/tests/src/Functional/Batch/PageTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\system\Functional\Batch;
use Drupal\Tests\BrowserTestBase;
class PageTest extends BrowserTestBase {
protected static $modules = [
'batch_test',
];
protected $defaultTheme = 'stark';
public function testBatchProgressPageTheme() {
$this->container
->get('theme_installer')
->install([
'claro',
'olivero',
]);
$this
->config('system.theme')
->set('default', 'olivero')
->set('admin', 'claro')
->save();
$admin_user = $this
->drupalCreateUser([
'view the administration theme',
]);
$this
->drupalLogin($admin_user);
$this
->drupalGet('admin/batch-test/test-theme');
$this
->assertEquals([
'claro',
], batch_test_stack(), 'A progressive batch correctly uses the theme of the page that started the batch.');
}
public function testBatchProgressPageTitle() {
$this->maximumMetaRefreshCount = 0;
$this
->drupalGet('batch-test/test-title');
$this
->assertSession()
->pageTextContains('Batch Test');
$this->maximumMetaRefreshCount = NULL;
$this
->drupalGet('batch-test/test-title');
$this
->assertEquals([
'Batch Test',
], batch_test_stack(), 'The batch title is shown on the batch page.');
$this
->assertSession()
->pageTextContains('Redirection successful.');
}
public function testBatchProgressMessages() {
$this->maximumMetaRefreshCount = 0;
$this
->drupalGet('batch-test/test-title');
$this
->assertSession()
->responseContains('<div class="progress__description">Initializing.<br /> </div>');
$this
->assertSession()
->responseNotContains('&nbsp;');
$this->maximumMetaRefreshCount = 1;
$this
->drupalGet('batch-test/test-title');
$this
->assertSession()
->responseContains('<div class="progress__description">Completed 1 of 1.</div>');
}
}
Classes
Name |
Description |
PageTest |
Tests the content of the progress page. |