3 namespace Drupal\Tests\block\Functional;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests block module's installation.
12 class BlockInstallTest extends BrowserTestBase {
14 public function testCacheTagInvalidationUponInstallation() {
15 // Warm the page cache.
17 $this->assertNoText('Powered by Drupal');
18 $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:block_list');
20 // Install the block module, and place the "Powered by Drupal" block.
21 $this->container->get('module_installer')->install(['block', 'shortcut']);
22 $this->rebuildContainer();
23 $this->container->get('router.builder')->rebuild();
24 $this->drupalPlaceBlock('system_powered_by_block');
26 // Check the same page, block.module's hook_install() should have
27 // invalidated the 'rendered' cache tag to make blocks show up.
29 $this->assertCacheTag('config:block_list');
30 $this->assertText('Powered by Drupal');