You are here

public function CorePagerReplaceTest::setUp in Pagerer 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/CorePagerReplaceTest.php \Drupal\Tests\pagerer\Functional\CorePagerReplaceTest::setUp()

Overrides PagerTest::setUp

File

tests/src/Functional/CorePagerReplaceTest.php, line 28

Class

CorePagerReplaceTest
Test replacement of Drupal core pager.

Namespace

Drupal\Tests\pagerer\Functional

Code

public function setUp() {
  BrowserTestBase::setUp();

  // Insert 300 log messages.
  $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',
  ]));
  $edit = [
    'label' => 'core_replace',
    'id' => 'core_replace',
  ];
  $this
    ->drupalPostForm($this->pagererAdmin . '/preset/add', $edit, 'Create');
  $edit = [
    'core_override_preset' => 'core_replace',
  ];
  $this
    ->drupalPostForm($this->pagererAdmin, $edit, 'Save configuration');
}