BlocacheBrowserTestBase.php in Blocache (Block Cache Control) 8
File
tests/src/Functional/BlocacheBrowserTestBase.php
View source
<?php
namespace Drupal\Tests\blocache\Functional;
use Drupal\Tests\BrowserTestBase;
abstract class BlocacheBrowserTestBase extends BrowserTestBase {
public static $modules = [
'block',
'blocache',
];
protected $regions;
protected $adminUser;
protected $blocacheMetadata;
protected function setUp() {
parent::setUp();
$this
->config('system.site')
->set('page.front', '/test-page')
->save();
$this->adminUser = $this
->drupalCreateUser([
'administer blocks',
'access administration pages',
'administer block cache',
]);
$this
->drupalLogin($this->adminUser);
$this->regions = [
'header',
'sidebar_first',
'content',
'sidebar_second',
'footer',
];
$block_storage = $this->container
->get('entity_type.manager')
->getStorage('block');
$blocks = $block_storage
->loadByProperties([
'theme' => $this
->config('system.theme')
->get('default'),
]);
foreach ($blocks as $block) {
$block
->delete();
}
}
}