protected function LayoutBuilderMigrationTest::setUp in Panelizer 8.5
Overrides KernelTestBase::setUp
File
- tests/
src/ Kernel/ LayoutBuilderMigrationTest.php, line 45
Class
- LayoutBuilderMigrationTest
- @coversDefaultClass \Drupal\panelizer\LayoutBuilderMigration
Namespace
Drupal\Tests\panelizer\KernelCode
protected function setUp() {
parent::setUp();
$this
->installSchema('system', [
'key_value_expire',
]);
$this
->installConfig('node');
$this
->createContentType([
'type' => 'page',
]);
/** @var \Drupal\panelizer\PanelizerInterface $panelizer */
$panelizer = $this->container
->get('panelizer');
$panelizer
->setPanelizerSettings('node', 'page', 'default', [
'enable' => TRUE,
'allow' => TRUE,
'custom' => TRUE,
'default' => 'default',
]);
$panelizer
->setDisplayStaticContexts('default', 'node', 'page', 'default', [
'value' => [
'type' => 'integer',
'label' => 'Lucky number',
'description' => "Today's winning lottery number",
'value' => 42,
],
'letter' => [
'type' => 'string',
'label' => 'Word of the day',
'description' => 'The word of the day, from the NATO phonetic alphabet',
'value' => 'Foxtrot',
],
]);
$default = $panelizer
->getDefaultPanelsDisplay('default', 'node', 'page', 'default');
$default
->addBlock([
'id' => 'context_block',
'region' => 'content',
'weight' => 0,
]);
$panelizer
->setDefaultPanelsDisplay('default', 'node', 'page', 'default', $default);
}