SystemLocalTasksTest.php in Zircon Profile 8.0
File
core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php
View source
<?php
namespace Drupal\Tests\system\Unit\Menu;
use Drupal\Core\Extension\Extension;
use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
class SystemLocalTasksTest extends LocalTaskIntegrationTestBase {
protected $themeHandler;
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->themeHandler
->expects($this
->any())
->method('hasUi')
->with('bartik')
->willReturn(TRUE);
$this->container
->set('theme_handler', $this->themeHandler);
}
public function testSystemAdminLocalTasks($route, $expected) {
$this
->assertLocalTasks($route, $expected);
}
public function getSystemAdminRoutes() {
return array(
array(
'system.admin_content',
array(
array(
'system.admin_content',
),
),
),
array(
'system.theme_settings_theme',
array(
array(
'system.themes_page',
'system.theme_settings',
),
array(
'system.theme_settings_global',
'system.theme_settings_theme:bartik',
),
),
),
);
}
}