function AnnotatedClassDiscoveryTest::testGetPluginNamespaces

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php \Drupal\Tests\Component\Annotation\AnnotatedClassDiscoveryTest::testGetPluginNamespaces()
  2. 10 core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php \Drupal\Tests\Component\Annotation\AnnotatedClassDiscoveryTest::testGetPluginNamespaces()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.