55f4b8a921eb49738b775825ed2001f4c995bbcc
[yaffs-website] / web / core / modules / block / src / Tests / BlockInstallTest.php
1 <?php
2
3 namespace Drupal\block\Tests;
4
5 use Drupal\simpletest\WebTestBase;
6
7 /**
8  * Tests block module's installation.
9  *
10  * @group block
11  */
12 class BlockInstallTest extends WebTestBase {
13
14   public function testCacheTagInvalidationUponInstallation() {
15     // Warm the page cache.
16     $this->drupalGet('');
17     $this->assertNoText('Powered by Drupal');
18     $this->assertNoCacheTag('config:block_list');
19
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');
25
26     // Check the same page, block.module's hook_install() should have
27     // invalidated the 'rendered' cache tag to make blocks show up.
28     $this->drupalGet('');
29     $this->assertCacheTag('config:block_list');
30     $this->assertText('Powered by Drupal');
31   }
32
33 }