Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / layout_builder / tests / src / Functional / Update / SectionDependenciesUpdatePathTest.php
1 <?php
2
3 namespace Drupal\Tests\layout_builder\Functional\Update;
4
5 use Drupal\Core\Entity\Entity\EntityViewDisplay;
6 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
7
8 /**
9  * Tests the upgrade path for Layout Builder section dependencies.
10  *
11  * @group layout_builder
12  * @group legacy
13  */
14 class SectionDependenciesUpdatePathTest extends UpdatePathTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   protected function setDatabaseDumpFiles() {
20     $this->databaseDumpFiles = [
21       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
22       __DIR__ . '/../../../fixtures/update/layout-builder.php',
23       __DIR__ . '/../../../fixtures/update/section-dependencies.php',
24     ];
25   }
26
27   /**
28    * Tests the upgrade path for Layout Builder section dependencies.
29    */
30   public function testRunUpdates() {
31     $data = EntityViewDisplay::load('node.article.teaser')->toArray();
32     $this->assertNotContains('system.menu.myothermenu', $data['dependencies']['config']);
33     $this->assertNotContains('layout_builder', $data['dependencies']['module']);
34     $this->assertNotContains('layout_test', $data['dependencies']['module']);
35
36     $this->runUpdates();
37
38     $data = EntityViewDisplay::load('node.article.teaser')->toArray();
39     $this->assertContains('system.menu.myothermenu', $data['dependencies']['config']);
40     $this->assertContains('layout_builder', $data['dependencies']['module']);
41     $this->assertContains('layout_test', $data['dependencies']['module']);
42   }
43
44 }