625844e36f7ee1bc60f42c162247337ae07b074a
[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  */
13 class SectionDependenciesUpdatePathTest extends UpdatePathTestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   protected function setDatabaseDumpFiles() {
19     $this->databaseDumpFiles = [
20       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
21       __DIR__ . '/../../../fixtures/update/section-dependencies.php',
22     ];
23   }
24
25   /**
26    * Tests the upgrade path for Layout Builder section dependencies.
27    */
28   public function testRunUpdates() {
29     $data = EntityViewDisplay::load('node.article.teaser')->toArray();
30     $this->assertNotContains('system.menu.myothermenu', $data['dependencies']['config']);
31     $this->assertNotContains('layout_builder', $data['dependencies']['module']);
32     $this->assertNotContains('layout_test', $data['dependencies']['module']);
33
34     $this->runUpdates();
35
36     $data = EntityViewDisplay::load('node.article.teaser')->toArray();
37     $this->assertContains('system.menu.myothermenu', $data['dependencies']['config']);
38     $this->assertContains('layout_builder', $data['dependencies']['module']);
39     $this->assertContains('layout_test', $data['dependencies']['module']);
40   }
41
42 }