diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php index 2e6c386..43464d1 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php @@ -97,8 +97,7 @@ protected function setUpEntityTypeDefinitions($definitions = []) { $entity_type->getLinkTemplates()->willReturn([]); // Give the entity type a legitimate class to return. - $entity_type->getClass()->willReturn('\\' . $class); - // Leading slashes will be trimmed. + $entity_type->getClass()->willReturn($class); $entity_type->setClass($class)->willReturn($entity_type->reveal()); $definitions[$key] = $entity_type->reveal(); diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php index 4ced547..0a6e8d4 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php @@ -438,6 +438,17 @@ public function providerTestProcessDefinition() { 'forms' => ['configure' => 'stdClass'], 'foo' => ['bar' => ['baz']], ]; + + $data['class_with_slashes'][] = [ + 'class' => '\Drupal\Tests\Core\Plugin\TestPluginForm', + ]; + $data['class_with_slashes'][] = [ + 'class' => 'Drupal\Tests\Core\Plugin\TestPluginForm', + 'foo' => ['bar' => ['baz']], + ]; + + $data['object_with_class_with_slashes'][] = (new PluginDefinition())->setClass('\Drupal\Tests\Core\Plugin\TestPluginForm'); + $data['object_with_class_with_slashes'][] = (new PluginDefinition())->setClass('Drupal\Tests\Core\Plugin\TestPluginForm'); return $data; }