/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->typedDataManager = $this->prophesize(TypedDataManager::class); $container = new ContainerBuilder(); $container->set('string_translation', $this->getStringTranslationStub()); $container->set('typed_data_manager', $this->typedDataManager->reveal()); \Drupal::setContainer($container); $this->page = $this->prophesize(PageInterface::class); $this->event = new PageManagerContextEvent($this->page->reveal()); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->pageVariant = new PageVariant(['id' => 'the_page_variant', 'page' => 'the_page'], 'page_variant'); $this->page = $this->prophesize(PageInterface::class); $entity_storage = $this->prophesize(EntityStorageInterface::class); $entity_storage->load('the_page')->willReturn($this->page->reveal()); $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class); $entity_type_manager->getStorage('page')->willReturn($entity_storage); $this->contextMapper = $this->prophesize(ContextMapperInterface::class); $container = new ContainerBuilder(); $container->set('entity_type.manager', $entity_type_manager->reveal()); $container->set('page_manager.context_mapper', $this->contextMapper->reveal()); \Drupal::setContainer($container); }
/** * @covers ::getPage */ public function testGetPage() { $this->assertSame($this->page->reveal(), $this->exectuable->getPage()); }