Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // TODO: Change the autogenerated stub
     $condition_plugin_manager = $this->getMock('Drupal\\Core\\Executable\\ExecutableManagerInterface');
     $condition_plugin_manager->expects($this->any())->method('getDefinitions')->will($this->returnValue(array()));
     $container = new ContainerBuilder();
     $container->set('plugin.manager.condition', $condition_plugin_manager);
     \Drupal::setContainer($container);
     $this->executable = $this->getMockBuilder('Drupal\\views\\ViewExecutable')->disableOriginalConstructor()->setMethods(['buildRenderable', 'setDisplay', 'setItemsPerPage'])->getMock();
     $this->executable->expects($this->any())->method('setDisplay')->with('block_1')->will($this->returnValue(TRUE));
     $this->executable->expects($this->any())->method('getShowAdminLinks')->willReturn(FALSE);
     $this->executable->display_handler = $this->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\Block')->disableOriginalConstructor()->setMethods(NULL)->getMock();
     $this->view = $this->getMockBuilder('Drupal\\views\\Entity\\View')->disableOriginalConstructor()->getMock();
     $this->view->expects($this->any())->method('id')->willReturn('test_view');
     $this->executable->storage = $this->view;
     $this->executableFactory = $this->getMockBuilder('Drupal\\views\\ViewExecutableFactory')->disableOriginalConstructor()->getMock();
     $this->executableFactory->expects($this->any())->method('get')->with($this->view)->will($this->returnValue($this->executable));
     $this->displayHandler = $this->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\Block')->disableOriginalConstructor()->getMock();
     $this->displayHandler->expects($this->any())->method('blockSettings')->willReturn([]);
     $this->displayHandler->expects($this->any())->method('getPluginId')->willReturn('block');
     $this->executable->display_handler = $this->displayHandler;
     $this->storage = $this->getMockBuilder('Drupal\\Core\\Config\\Entity\\ConfigEntityStorage')->disableOriginalConstructor()->getMock();
     $this->storage->expects($this->any())->method('load')->with('test_view')->will($this->returnValue($this->view));
     $this->account = $this->getMock('Drupal\\Core\\Session\\AccountInterface');
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function addCacheTags(array $cache_tags)
 {
     return $this->storage->addCacheTags($cache_tags);
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function hasTrustedData()
 {
     return $this->storage->hasTrustedData();
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function getThirdPartyProviders()
 {
     return $this->storage->getThirdPartyProviders();
 }