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

8.0.x
webchick 2014-02-06 23:19:43 -08:00
parent 255a33f541
commit 836d08a738
1 changed files with 13 additions and 6 deletions

View File

@ -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 @@ class LocalTaskDefaultTest extends UnitTestCase {
* 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 @@ class LocalTaskDefaultTest extends UnitTestCase {
}
}
class TestLocalTaskDefault extends LocalTaskDefault {
public function setRouteProvider(RouteProviderInterface $route_provider) {
$this->routeProvider = $route_provider;
return $this;
}
}