comparison core/modules/block/tests/src/Functional/BlockInstallTest.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 129ea1e6d783
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Tests\block\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8 * Tests block module's installation.
9 *
10 * @group block
11 */
12 class BlockInstallTest extends BrowserTestBase {
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 }