b71d47bfc8efa8c6a4214084b160e11e36370e6d
[yaffs-website] / web / core / modules / system / src / Tests / Update / StableBaseThemeUpdateTest.php
1 <?php
2
3 namespace Drupal\system\Tests\Update;
4
5 /**
6  * Tests the upgrade path for introducing the Stable base theme.
7  *
8  * @see https://www.drupal.org/node/2575421
9  *
10  * @group system
11  */
12 class StableBaseThemeUpdateTest extends UpdatePathTestBase {
13
14   /**
15    * The theme handler.
16    *
17    * @var \Drupal\Core\Extension\ThemeHandlerInterface
18    */
19   protected $themeHandler;
20
21   /**
22    * {@inheritdoc}
23    */
24   protected function setDatabaseDumpFiles() {
25     $this->databaseDumpFiles = [
26       __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
27       __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.stable-base-theme-2575421.php',
28     ];
29   }
30
31   /**
32    * {@inheritdoc}
33    */
34   protected function setUp() {
35     parent::setUp();
36     $this->themeHandler = $this->container->get('theme_handler');
37     $this->themeHandler->refreshInfo();
38   }
39
40   /**
41    * Tests that the Stable base theme is installed if necessary.
42    */
43   public function testUpdateHookN() {
44     $this->assertTrue($this->themeHandler->themeExists('test_stable'));
45     $this->assertFalse($this->themeHandler->themeExists('stable'));
46
47     $this->runUpdates();
48
49     // Refresh the theme handler now that Stable has been installed.
50     $this->themeHandler->refreshInfo();
51     $this->assertTrue($this->themeHandler->themeExists('stable'));
52   }
53
54 }