protected function AutoExportTest::setUp in Fixed Block Content 8
Overrides FixedBlockContentKernelTestBase::setUp
File
- tests/
src/ Kernel/ AutoExportTest.php, line 26
Class
- AutoExportTest
- Tests the auto-create option of fixed blocks.
Namespace
Drupal\Tests\fixed_block_content\KernelCode
protected function setUp() {
parent::setUp();
// Export the initial config, including fixed blocks from the test module.
$this
->copyConfig($this->container
->get('config.storage'), $this->container
->get('config.storage.sync'));
// Clean up default content in the test fixed blocks.
$entity_storage = $this->entityTypeManager
->getStorage('fixed_block_content');
foreach ($entity_storage
->loadMultiple($this->testBlocksId) as $fixed_block) {
/** @var \Drupal\fixed_block_content\FixedBlockContentInterface $fixed_block */
$fixed_block
->set('default_content', '');
$fixed_block
->save();
}
}