public function LayoutDiscoveryDependenciesUpdateTest::testUpdatedLayoutDiscoveryDependencies in Drupal 8
Tests updating the dependencies for layout discovery based entity displays.
File
- core/
modules/ layout_discovery/ tests/ src/ Functional/ Update/ LayoutDiscoveryDependenciesUpdateTest.php, line 33
Class
- LayoutDiscoveryDependenciesUpdateTest
- Tests the upgrade path for updating the layout discovery dependencies.
Namespace
Drupal\Tests\layout_discovery\Functional\UpdateCode
public function testUpdatedLayoutDiscoveryDependencies() {
$entities = [
EntityFormDisplay::load('node.page.default'),
EntityViewDisplay::load('node.page.default'),
];
foreach ($entities as $entity) {
$dependencies = $entity
->getDependencies();
$this
->assertTrue(in_array('test_layout_theme', $dependencies['module']));
$this
->assertFalse(isset($dependencies['theme']));
}
$this
->runUpdates();
$updated_entities = [
EntityFormDisplay::load('node.page.default'),
EntityViewDisplay::load('node.page.default'),
];
foreach ($updated_entities as $updated_entity) {
$dependencies = $updated_entity
->getDependencies();
$this
->assertFalse(in_array('test_layout_theme', $dependencies['module']));
$this
->assertTrue(in_array('test_layout_theme', $dependencies['theme']));
}
}