Commit 836d08a7 authored by webchick's avatar webchick

Issue #2183881 by tim.plunkett: Remove Drupal::setContainer from LocalTaskDefaultTest.

parent 255a33f5
......@@ -7,8 +7,8 @@
namespace Drupal\Tests\Core\Menu;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\Menu\LocalTaskDefault;
use Drupal\Core\Routing\RouteProviderInterface;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\HttpFoundation\Request;
......@@ -84,11 +84,11 @@ protected function setUp() {
* Setups the local task default.
*/
protected function setupLocalTaskDefault() {
$container = new ContainerBuilder();
$container->set('string_translation', $this->stringTranslation);
$container->set('router.route_provider', $this->routeProvider);
\Drupal::setContainer($container);
$this->localTaskBase = new LocalTaskDefault($this->config, $this->pluginId, $this->pluginDefinition);
$this->localTaskBase = new TestLocalTaskDefault($this->config, $this->pluginId, $this->pluginDefinition);
$this->localTaskBase
->setRouteProvider($this->routeProvider)
->setTranslationManager($this->stringTranslation);
}
/**
......@@ -316,3 +316,10 @@ public function testGetOptions() {
}
}
class TestLocalTaskDefault extends LocalTaskDefault {
public function setRouteProvider(RouteProviderInterface $route_provider) {
$this->routeProvider = $route_provider;
return $this;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment