Skip to content
Snippets Groups Projects

Issue #3285529: UserLocalTask does not check that route exists

Closed Benji Fisher requested to merge issue/drupal-3285529:3285529-inject-route-provider into 9.5.x
Files
4
@@ -3,6 +3,7 @@
namespace Drupal\Tests\shortcut\Unit\Menu;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Routing\RouteProviderInterface;
use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
/**
@@ -25,6 +26,11 @@ protected function setUp(): void {
->method('getDefinitions')
->will($this->returnValue([]));
$this->container->set('entity_type.manager', $entity_type_manager);
$route_provider = $this->createMock(RouteProviderInterface::class);
$route_provider->expects($this->any())
->method('getRoutesByNames')
->will($this->returnValue(['not empty']));
$this->container->set('router.route_provider', $route_provider);
$this->container->set('string_translation', $this->getStringTranslationStub());
}
Loading