BlockInstallTest.php in Drupal 9
File
core/modules/block/tests/src/Functional/BlockInstallTest.php
View source
<?php
namespace Drupal\Tests\block\Functional;
use Drupal\Tests\BrowserTestBase;
class BlockInstallTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
public function testCacheTagInvalidationUponInstallation() {
$this
->drupalGet('');
$this
->assertSession()
->pageTextNotContains('Powered by Drupal');
$this
->assertSession()
->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:block_list');
$this->container
->get('module_installer')
->install([
'block',
'shortcut',
]);
$this
->rebuildContainer();
$this
->drupalPlaceBlock('system_powered_by_block');
$this
->drupalGet('');
$this
->assertSession()
->responseHeaderContains('X-Drupal-Cache-Tags', 'config:block_list');
$this
->assertSession()
->pageTextContains('Powered by Drupal');
}
}