/** * {@inheritdoc} */ public function buildRegions(array $build) { $regions = parent::buildRegions($build); $layout = $this->getLayout(); return $layout->build($regions); }
/** * Tests the submitConfigurationForm() method. * * @covers ::submitConfigurationForm */ public function testSubmitConfigurationForm() { $account = $this->prophesize(AccountInterface::class); $context_handler = $this->prophesize(ContextHandlerInterface::class); $uuid_generator = $this->prophesize(UuidInterface::class); $token = $this->prophesize(Token::class); $block_manager = $this->prophesize(BlockManager::class); $condition_manager = $this->prophesize(ConditionManager::class); $module_handler = $this->prophesize(ModuleHandlerInterface::class); $variant_plugin = new PageBlockDisplayVariant([], '', [], $context_handler->reveal(), $account->reveal(), $uuid_generator->reveal(), $token->reveal(), $block_manager->reveal(), $condition_manager->reveal(), $module_handler->reveal()); $values = ['page_title' => "Go hang a salami, I'm a lasagna hog!"]; $form = []; $form_state = (new FormState())->setValues($values); $variant_plugin->submitConfigurationForm($form, $form_state); $property = new \ReflectionProperty($variant_plugin, 'configuration'); $property->setAccessible(TRUE); $this->assertSame($values['page_title'], $property->getValue($variant_plugin)['page_title']); }