protected function BlockCacheTest::setUp in Drupal 8
Same name and namespace in other branches
- 9 core/modules/block/tests/src/Functional/BlockCacheTest.php \Drupal\Tests\block\Functional\BlockCacheTest::setUp()
Overrides BrowserTestBase::setUp
File
- core/
modules/ block/ tests/ src/ Functional/ BlockCacheTest.php, line 55
Class
- BlockCacheTest
- Tests block caching.
Namespace
Drupal\Tests\block\FunctionalCode
protected function setUp() {
parent::setUp();
// Create an admin user, log in and enable test blocks.
$this->adminUser = $this
->drupalCreateUser([
'administer blocks',
'access administration pages',
]);
$this
->drupalLogin($this->adminUser);
// Create additional users to test caching modes.
$this->normalUser = $this
->drupalCreateUser();
$this->normalUserAlt = $this
->drupalCreateUser();
// Sync the roles, since drupalCreateUser() creates separate roles for
// the same permission sets.
$this->normalUserAlt->roles = $this->normalUser
->getRoles();
$this->normalUserAlt
->save();
// Enable our test block.
$this->block = $this
->drupalPlaceBlock('test_cache');
}