/** * {@inheritdoc} * * @covers ::__construct() */ protected function setUp() { parent::setUp(); $this->requestMatcher = $this->getMock('\\Symfony\\Component\\Routing\\Matcher\\RequestMatcherInterface'); $config_factory = $this->getConfigFactoryStub(array('system.site' => array('front' => 'test_frontpage'))); $this->pathProcessor = $this->getMock('\\Drupal\\Core\\PathProcessor\\InboundPathProcessorInterface'); $this->context = $this->getMock('\\Symfony\\Component\\Routing\\RequestContext'); $this->accessManager = $this->getMock('\\Drupal\\Core\\Access\\AccessManagerInterface'); $this->titleResolver = $this->getMock('\\Drupal\\Core\\Controller\\TitleResolverInterface'); $this->currentUser = $this->getMock('Drupal\\Core\\Session\\AccountInterface'); $this->builder = new TestPathBasedBreadcrumbBuilder($this->context, $this->accessManager, $this->requestMatcher, $this->pathProcessor, $config_factory, $this->titleResolver, $this->currentUser); $this->builder->setStringTranslation($this->getStringTranslationStub()); }
/** * {@inheritdoc} * * @covers ::__construct */ protected function setUp() { parent::setUp(); $this->requestMatcher = $this->getMock('\\Symfony\\Component\\Routing\\Matcher\\RequestMatcherInterface'); $config_factory = $this->getConfigFactoryStub(array('system.site' => array('front' => 'test_frontpage'))); $this->pathProcessor = $this->getMock('\\Drupal\\Core\\PathProcessor\\InboundPathProcessorInterface'); $this->context = $this->getMock('\\Drupal\\Core\\Routing\\RequestContext'); $this->accessManager = $this->getMock('\\Drupal\\Core\\Access\\AccessManagerInterface'); $this->titleResolver = $this->getMock('\\Drupal\\Core\\Controller\\TitleResolverInterface'); $this->currentUser = $this->getMock('Drupal\\Core\\Session\\AccountInterface'); $this->currentPath = $this->getMockBuilder('Drupal\\Core\\Path\\CurrentPathStack')->disableOriginalConstructor()->getMock(); $this->builder = new TestPathBasedBreadcrumbBuilder($this->context, $this->accessManager, $this->requestMatcher, $this->pathProcessor, $config_factory, $this->titleResolver, $this->currentUser, $this->currentPath); $this->builder->setStringTranslation($this->getStringTranslationStub()); $cache_contexts_manager = $this->getMockBuilder('Drupal\\Core\\Cache\\Context\\CacheContextsManager')->disableOriginalConstructor()->getMock(); $cache_contexts_manager->expects($this->any())->method('validate_tokens'); $container = new Container(); $container->set('cache_contexts_manager', $cache_contexts_manager); \Drupal::setContainer($container); }