3 namespace Drupal\Tests\block_content\Unit\Menu;
5 use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
6 use Symfony\Component\DependencyInjection\ContainerBuilder;
9 * Tests existence of block_content local tasks.
11 * @group block_content
13 class BlockContentLocalTasksTest extends LocalTaskIntegrationTestBase {
15 protected function setUp() {
16 $this->directoryList = [
17 'block' => 'core/modules/block',
18 'block_content' => 'core/modules/block_content',
22 $config_factory = $this->getConfigFactoryStub([
23 'system.theme' => ['default' => 'test_c'],
27 $themes['test_a'] = (object) [
30 $themes['test_b'] = (object) [
36 $themes['test_c'] = (object) [
42 $theme_handler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface');
43 $theme_handler->expects($this->any())
45 ->will($this->returnValue($themes));
47 $container = new ContainerBuilder();
48 $container->set('config.factory', $config_factory);
49 $container->set('theme_handler', $theme_handler);
50 \Drupal::setContainer($container);
54 * Checks block_content listing local tasks.
56 * @dataProvider getBlockContentListingRoutes
58 public function testBlockContentListLocalTasks($route) {
59 $this->assertLocalTasks($route, [
61 'block.admin_display',
62 'entity.block_content.collection',
65 'block_content.list_sub',
66 'entity.block_content_type.collection',
72 * Provides a list of routes to test.
74 public function getBlockContentListingRoutes() {
76 ['entity.block_content.collection', 'entity.block_content_type.collection'],