diff --git a/core/lib/Drupal/Core/Condition/ConditionManager.php b/core/lib/Drupal/Core/Condition/ConditionManager.php index 890ef5f..c912a8e 100644 --- a/core/lib/Drupal/Core/Condition/ConditionManager.php +++ b/core/lib/Drupal/Core/Condition/ConditionManager.php @@ -69,7 +69,7 @@ public function createInstance($plugin_id, array $configuration = array()) { */ public function execute(ExecutableInterface $condition) { if (!($condition instanceof ConditionInterface)) { - throw new \InvalidArgumentException(sprintf('%s must be an instance of %s, but %s was given.', '$condition', '\Drupal\Core\Condition\ConditionInterface', get_class($condition))); + throw new \InvalidArgumentException(sprintf('%s must be an instance of %s, but %s was given.', '$condition', ConditionInterface::class, get_class($condition))); } return $condition->evaluate(); diff --git a/core/tests/Drupal/Tests/Core/Condition/ConditionManagerTest.php b/core/tests/Drupal/Tests/Core/Condition/ConditionManagerTest.php index ae400ba..59202df 100644 --- a/core/tests/Drupal/Tests/Core/Condition/ConditionManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Condition/ConditionManagerTest.php @@ -7,7 +7,10 @@ namespace Drupal\Tests\Core\Condition; +use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Condition\ConditionInterface; use Drupal\Core\Condition\ConditionManager; +use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Tests\UnitTestCase; use Zend\Stdlib\ArrayObject; @@ -43,9 +46,9 @@ class ConditionManagerTest extends UnitTestCase { * {@inheritdoc} */ public function setUp() { - $this->moduleHandler = $this->getMock('\Drupal\Core\Extension\ModuleHandlerInterface'); + $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class); - $this->cache = $this->getMock('\Drupal\Core\Cache\CacheBackendInterface'); + $this->cache = $this->getMock(CacheBackendInterface::class); $namespaces = new ArrayObject(); @@ -66,7 +69,7 @@ public function testConstruct() { public function testExecute() { $execution_result = $this->randomMachineName(); - $condition = $this->getMock('\Drupal\Core\Condition\ConditionInterface'); + $condition = $this->getMock(ConditionInterface::class); $condition->expects($this->atLeastOnce()) ->method('evaluate') ->willReturn($execution_result);