class LayoutBuilderContextMappingUpdatePathTest
Tests the upgrade path for Layout Builder layout context mappings.
@group layout_builder
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase uses \Drupal\Tests\UpdatePathTestTrait implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\layout_builder\Functional\Update\LayoutBuilderContextMappingUpdatePathTest implements \Drupal\FunctionalTests\Update\UpdatePathTestBase
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase uses \Drupal\Tests\UpdatePathTestTrait implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of LayoutBuilderContextMappingUpdatePathTest
See also
layout_builder_post_update_section_storage_context_mapping()
File
-
core/
modules/ layout_builder/ tests/ src/ Functional/ Update/ LayoutBuilderContextMappingUpdatePathTest.php, line 15
Namespace
Drupal\Tests\layout_builder\Functional\UpdateView source
class LayoutBuilderContextMappingUpdatePathTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-9.0.0.bare.standard.php.gz',
__DIR__ . '/../../../fixtures/update/layout-builder.php',
__DIR__ . '/../../../fixtures/update/layout-builder-context-mapping.php',
];
}
/**
* Tests the upgrade path for Layout Builder layout context mappings.
*/
public function testRunUpdates() {
$data = EntityViewDisplay::load('node.article.teaser')->toArray();
$this->assertSame(TRUE, $data['third_party_settings']['layout_builder']['enabled']);
$this->assertArrayNotHasKey('context_mapping', $data['third_party_settings']['layout_builder']['sections'][0]->toArray()['layout_settings']);
$this->runUpdates();
$data = EntityViewDisplay::load('node.article.teaser')->toArray();
$this->assertSame(TRUE, $data['third_party_settings']['layout_builder']['enabled']);
$this->assertSame([], $data['third_party_settings']['layout_builder']['sections'][0]->toArray()['layout_settings']['context_mapping']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.