Updated to Drupal 8.5. Core Media not yet in use.
[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  */
14 class StableBaseThemeUpdateTest extends UpdatePathTestBase {
15
16   /**
17    * The theme handler.
18    *
19    * @var \Drupal\Core\Extension\ThemeHandlerInterface
20    */
21   protected $themeHandler;
22
23   /**
24    * {@inheritdoc}
25    */
26   protected function setDatabaseDumpFiles() {
27     $this->databaseDumpFiles = [
28       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
29       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.stable-base-theme-2575421.php',
30     ];
31   }
32
33   /**
34    * {@inheritdoc}
35    */
36   protected function setUp() {
37     parent::setUp();
38     $this->themeHandler = $this->container->get('theme_handler');
39     $this->themeHandler->refreshInfo();
40   }
41
42   /**
43    * Tests that the Stable base theme is installed if necessary.
44    */
45   public function testUpdateHookN() {
46     $this->assertTrue($this->themeHandler->themeExists('test_stable'));
47     $this->assertFalse($this->themeHandler->themeExists('stable'));
48
49     $this->runUpdates();
50
51     // Refresh the theme handler now that Stable has been installed.
52     $this->themeHandler->refreshInfo();
53     $this->assertTrue($this->themeHandler->themeExists('stable'));
54   }
55
56 }