/** * {@inheritdoc} */ public function setUp() { parent::setUp(); // Set the path of the module dynamically. $module_path = str_replace(\Drupal::root(), '', __DIR__); $module_path = str_replace('tests/src/Unit/Menu', '', $module_path); $module_path = trim($module_path, '/'); $this->directoryList = array('search_api' => $module_path); }
protected function setUp() { $this->directoryList = array('content_translation' => 'core/modules/content_translation', 'node' => 'core/modules/node'); parent::setUp(); $entity_type = $this->getMock('Drupal\\Core\\Entity\\EntityTypeInterface'); $entity_type->expects($this->any())->method('getLinkTemplate')->will($this->returnValueMap(array(array('canonical', 'entity.node.canonical'), array('drupal:content-translation-overview', 'entity.node.content_translation_overview')))); $content_translation_manager = $this->getMock('Drupal\\content_translation\\ContentTranslationManagerInterface'); $content_translation_manager->expects($this->any())->method('getSupportedEntityTypes')->will($this->returnValue(array('node' => $entity_type))); \Drupal::getContainer()->set('content_translation.manager', $content_translation_manager); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->directoryList = array('system' => 'core/modules/system'); $this->themeHandler = $this->getMock('Drupal\\Core\\Extension\\ThemeHandlerInterface'); $theme = new Extension($this->root, 'theme', '/core/themes/bartik', 'bartik.info.yml'); $theme->status = 1; $theme->info = array('name' => 'bartik'); $this->themeHandler->expects($this->any())->method('listInfo')->will($this->returnValue(array('bartik' => $theme))); $this->container->set('theme_handler', $this->themeHandler); }
protected function setUp() { $this->directoryList = array('block' => 'core/modules/block', 'block_content' => 'core/modules/block_content'); parent::setUp(); $config_factory = $this->getConfigFactoryStub(array('system.theme' => array('default' => 'test_c'))); $themes = array(); $themes['test_a'] = (object) array('status' => 0); $themes['test_b'] = (object) array('status' => 1, 'info' => array('name' => 'test_b')); $themes['test_c'] = (object) array('status' => 1, 'info' => array('name' => 'test_c')); $theme_handler = $this->getMock('Drupal\\Core\\Extension\\ThemeHandlerInterface'); $theme_handler->expects($this->any())->method('listInfo')->will($this->returnValue($themes)); $container = new ContainerBuilder(); $container->set('config.factory', $config_factory); $container->set('theme_handler', $theme_handler); \Drupal::setContainer($container); }
protected function setUp() { $this->directoryList = array('action' => 'core/modules/action'); parent::setUp(); }
protected function setUp() { $this->directoryList = array('shortcut' => 'core/modules/shortcut', 'user' => 'core/modules/user'); parent::setUp(); }
protected function setUp() { $this->directoryList = array('taxonomy' => 'core/modules/taxonomy'); parent::setUp(); }
protected function setUp() { $this->directoryList = array('book' => 'core/modules/book', 'node' => 'core/modules/node'); parent::setUp(); }
protected function setUp() { $this->directoryList = array('language' => 'core/modules/language'); parent::setUp(); }