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