You are here

public function AnnotatedClassDiscoveryTest::testGetPluginNamespaces in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php \Drupal\Tests\Component\Annotation\AnnotatedClassDiscoveryTest::testGetPluginNamespaces()

@covers ::__construct @covers ::getPluginNamespaces

File

core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php, line 32

Class

AnnotatedClassDiscoveryTest
@coversDefaultClass \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery @group Annotation @runTestsInSeparateProcesses

Namespace

Drupal\Tests\Component\Annotation

Code

public function testGetPluginNamespaces() {
  $discovery = new AnnotatedClassDiscovery([
    'com/example' => [
      __DIR__,
    ],
  ]);
  $reflection = new \ReflectionMethod($discovery, 'getPluginNamespaces');
  $reflection
    ->setAccessible(TRUE);
  $result = $reflection
    ->invoke($discovery);
  $this
    ->assertEquals([
    'com/example' => [
      __DIR__,
    ],
  ], $result);
}