3 namespace Drupal\Tests\layout_builder\Functional\Update;
5 use Drupal\Core\Entity\Entity\EntityViewDisplay;
6 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
9 * Tests the upgrade path for Layout Builder section dependencies.
11 * @group layout_builder
13 class SectionDependenciesUpdatePathTest extends UpdatePathTestBase {
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',
26 * Tests the upgrade path for Layout Builder section dependencies.
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']);
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']);