diff --git a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php index f189f95..7375004 100644 --- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php +++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php @@ -16,6 +16,7 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Language\LanguageManager; +use Drupal\Core\Language\Language; use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery; /** @@ -117,7 +118,7 @@ public function setCache(CacheBackendInterface $cache, LanguageManager $language $this->languageManager = $language_manager; $this->cache = $cache; $this->cacheKeyPrefix = $cache_key_prefix; - $this->cacheKey = $cache_key_prefix . ':' . $language_manager->getLanguage(LANGUAGE_TYPE_INTERFACE)->langcode; + $this->cacheKey = $cache_key_prefix . ':' . $language_manager->getLanguage(Language::TYPE_INTERFACE)->langcode; } /** diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php index 6397640..9b8a421 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php @@ -8,20 +8,8 @@ namespace Drupal\Tests\Core\Plugin; use Drupal\Core\Language\Language; -use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Tests\UnitTestCase; -// @todo Remove once http://drupal.org/node/1620010 is committed. -if (!defined('LANGUAGE_TYPE_INTERFACE')) { - define('LANGUAGE_TYPE_INTERFACE', 'language_interface'); -} -if (!defined('LANGUAGE_LTR')) { - define('LANGUAGE_LTR', 0); -} -if (!defined('LANGUAGE_RTL')) { - define('LANGUAGE_RTL', 1); -} - /** * Tests the DefaultPluginManager. * @@ -123,7 +111,7 @@ public function testDefaultPluginManagerWithEmptyCache() { $language_manager = $this->getMock('Drupal\Core\Language\LanguageManager'); $language_manager->expects($this->once()) ->method('getLanguage') - ->with(LANGUAGE_TYPE_INTERFACE) + ->with(Language::TYPE_INTERFACE) ->will($this->returnValue($language)); $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions); @@ -154,7 +142,7 @@ public function testDefaultPluginManagerWithFilledCache() { $language_manager = $this->getMock('Drupal\Core\Language\LanguageManager'); $language_manager->expects($this->once()) ->method('getLanguage') - ->with(LANGUAGE_TYPE_INTERFACE) + ->with(Language::TYPE_INTERFACE) ->will($this->returnValue($language)); $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions);