/** * {@inheritdoc} * * @covers ::__construct */ protected function setUp() { $this->pageStorage = $this->prophesize(ConfigEntityStorageInterface::class); $this->entityManager = $this->prophesize(EntityManagerInterface::class); $this->entityManager->getStorage('page')->willReturn($this->pageStorage); $this->routeSubscriber = new PageManagerRoutes($this->entityManager->reveal()); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $container = new ContainerBuilder(); $this->manager = $this->prophesize(PluginManagerInterface::class); $container->set('plugin.manager.display_variant', $this->manager->reveal()); \Drupal::setContainer($container); }
/** * @covers ::__construct */ public function setUp() { parent::setUp(); $this->contextHandler = $this->prophesize(ContextHandlerInterface::class); $this->entityType = $this->prophesize(EntityTypeInterface::class); $module_handler = $this->prophesize(ModuleHandlerInterface::class); $module_handler->invokeAll(Argument::cetera())->willReturn([]); $this->pageAccess = new PageAccess($this->entityType->reveal(), $this->contextHandler->reveal()); $this->pageAccess->setModuleHandler($module_handler->reveal()); }
/** * {@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->executable = $this->getMockBuilder(PageExecutable::class)->disableOriginalConstructor()->setMethods(['getPage', 'addContext'])->getMock(); $this->event = new PageManagerContextEvent($this->executable); }
/** * @covers ::__construct */ public function setUp() { parent::setUp(); $this->contextHandler = $this->prophesize(ContextHandlerInterface::class); $this->entityType = $this->prophesize(EntityTypeInterface::class); $module_handler = $this->prophesize(ModuleHandlerInterface::class); $module_handler->invokeAll(Argument::cetera())->willReturn([]); $this->pageAccess = new PageAccess($this->entityType->reveal(), $this->contextHandler->reveal()); $this->pageAccess->setModuleHandler($module_handler->reveal()); $this->cacheContextsManager = $this->prophesize(CacheContextsManager::class); $container = new ContainerBuilder(); $container->set('cache_contexts_manager', $this->cacheContextsManager->reveal()); \Drupal::setContainer($container); }
/** * @covers ::getPage */ public function testGetPage() { $this->assertSame($this->page->reveal(), $this->exectuable->getPage()); }
private function getFilelib($mockedEventDispatcher) { $filelib = new FileLibrary(new MemoryStorageAdapter(), new MemoryBackendAdapter(), $mockedEventDispatcher ? $this->ed->reveal() : new EventDispatcher()); $filelib->addProfile(new FileProfile('tussi', false)); return $filelib; }