diff --git a/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php b/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php index 6114986..ee83fa3 100644 --- a/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php +++ b/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php @@ -130,7 +130,8 @@ protected function getTheme() { public function build() { $build = array(); - $contexts = $this->dispatcher->dispatch(BlockEvents::ACTIVE_CONTEXT, new BlockContextEvent())->getContexts(); + $event = $this->dispatcher->dispatch(BlockEvents::ACTIVE_CONTEXT, new BlockContextEvent()); + $contexts = $event->getContexts(); // Load all region content assigned via blocks. foreach ($this->getRegionAssignments() as $region => $blocks) { /** @var $blocks \Drupal\block\BlockInterface[] */ diff --git a/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php index c26ee66..2c03f23 100644 --- a/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php @@ -126,10 +126,6 @@ public function testBuild() { $definition['provider'] = 'views'; $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storage, $this->account); - $reflector = new \ReflectionClass($plugin); - $property = $reflector->getProperty('conditionPluginManager'); - $property->setAccessible(TRUE); - $property->setValue($plugin, $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface')); $this->assertEquals($build, $plugin->build()); } @@ -152,10 +148,6 @@ public function testBuildFailed() { $definition['provider'] = 'views'; $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storage, $this->account); - $reflector = new \ReflectionClass($plugin); - $property = $reflector->getProperty('conditionPluginManager'); - $property->setAccessible(TRUE); - $property->setValue($plugin, $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface')); $this->assertEquals(array(), $plugin->build()); }