class SimpleConfigSectionListTest
Same name and namespace in other branches
- 11.x core/modules/layout_builder/tests/src/Kernel/SimpleConfigSectionListTest.php \Drupal\Tests\layout_builder\Kernel\SimpleConfigSectionListTest
Tests the test implementation of section storage.
@coversDefaultClass \Drupal\layout_builder_test\Plugin\SectionStorage\SimpleConfigSectionStorage
@group layout_builder
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Entity\EntityKernelTestBase uses \Drupal\Tests\user\Traits\UserCreationTrait implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\layout_builder\Kernel\SectionListTestBase implements \Drupal\KernelTests\Core\Entity\EntityKernelTestBase
- class \Drupal\Tests\layout_builder\Kernel\SimpleConfigSectionListTest implements \Drupal\Tests\layout_builder\Kernel\SectionListTestBase
- class \Drupal\Tests\layout_builder\Kernel\SectionListTestBase implements \Drupal\KernelTests\Core\Entity\EntityKernelTestBase
- class \Drupal\KernelTests\Core\Entity\EntityKernelTestBase uses \Drupal\Tests\user\Traits\UserCreationTrait implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of SimpleConfigSectionListTest
File
-
core/
modules/ layout_builder/ tests/ src/ Kernel/ SimpleConfigSectionListTest.php, line 18
Namespace
Drupal\Tests\layout_builder\KernelView source
class SimpleConfigSectionListTest extends SectionListTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'layout_builder_test',
];
/**
* {@inheritdoc}
*/
protected function getSectionList(array $section_data) {
$config = $this->container
->get('config.factory')
->getEditable('layout_builder_test.test_simple_config.foobar');
$section_data = array_map(function (Section $section) {
return $section->toArray();
}, $section_data);
$config->set('sections', $section_data)
->save();
$definition = new SectionStorageDefinition([
'id' => 'test_simple_config',
]);
$plugin = SimpleConfigSectionStorage::create($this->container, [], 'test_simple_config', $definition);
$plugin->setContext('config_id', new Context(new ContextDefinition('string'), 'foobar'));
return $plugin;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.