diff --git a/core/modules/layout_builder/tests/modules/layout_builder_overrides_test/src/Plugin/SectionStorage/TestOverridesSectionStorage.php b/core/modules/layout_builder/tests/modules/layout_builder_overrides_test/src/Plugin/SectionStorage/TestOverridesSectionStorage.php index be128d9e23..127fd0dad4 100644 --- a/core/modules/layout_builder/tests/modules/layout_builder_overrides_test/src/Plugin/SectionStorage/TestOverridesSectionStorage.php +++ b/core/modules/layout_builder/tests/modules/layout_builder_overrides_test/src/Plugin/SectionStorage/TestOverridesSectionStorage.php @@ -16,6 +16,7 @@ class TestOverridesSectionStorage extends OverridesSectionStorage { */ protected function getSectionList() { \Drupal::state()->set('layout_builder_test_storage', [ + static::class, $this->getPluginDefinition()->get('weight'), $this->getContextValue('view_mode'), ]); diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php index 10ec96da4b..3e517c2aee 100644 --- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\layout_builder\Functional; +use Drupal\layout_builder_overrides_test\Plugin\SectionStorage\TestOverridesSectionStorage; use Drupal\Tests\BrowserTestBase; /** @@ -66,10 +67,11 @@ public function testRenderByContextAwarePluginDelegate() { $this->drupalGet('node/1'); // During layout rendering, the storage plugin used for testing will set the - // state key to an array containing the plugin weight and view mode, which - // proves that the plugin matched the appropriate contexts and was actually - // used to render the layout. - list ($weight, $view_mode) = $state->get($state_key); + // state key to an array containing the plugin class, weight, and view mode, + // which proves that the plugin matched the appropriate contexts and was + // actually used to render the layout. + list ($class, $weight, $view_mode) = $state->get($state_key); + $this->assertSame(TestOverridesSectionStorage::class, $class); $this->assertSame(-100, $weight); $this->assertSame('default', $view_mode); }