CorePagerReplaceTest.php in Pagerer 8.2
File
tests/src/Functional/CorePagerReplaceTest.php
View source
<?php
namespace Drupal\Tests\pagerer\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\system\Functional\Pager\PagerTest;
class CorePagerReplaceTest extends PagerTest {
protected $pagererAdmin = 'admin/config/user-interface/pagerer';
public static $modules = [
'dblog',
'image',
'pager_test',
'pagerer',
'pagerer_test',
];
public function setUp() : void {
BrowserTestBase::setUp();
$logger = $this->container
->get('logger.factory')
->get('pager_test');
for ($i = 0; $i < 300; $i++) {
$logger
->debug($this
->randomString());
}
$this
->drupalLogin($this
->drupalCreateUser([
'access site reports',
'administer image styles',
'administer site configuration',
]));
$this
->drupalGet($this->pagererAdmin . '/preset/add');
$this
->submitForm([
'label' => 'core_replace',
'id' => 'core_replace',
], 'Create');
$this
->drupalGet($this->pagererAdmin);
$this
->submitForm([
'core_override_preset' => 'core_replace',
], 'Save configuration');
}
public function testPagerQueryParametersAndCacheContext() {
parent::testPagerQueryParametersAndCacheContext();
$this
->assertSession()
->responseHeaderContains('X-Drupal-Cache-Tags', 'config:pagerer.settings');
$this
->assertSession()
->responseHeaderContains('X-Drupal-Cache-Tags', 'config:pagerer.preset.core_replace');
}
}