function AttributeClassDiscoveryTest::testGetPluginNamespaces

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryTest.php \Drupal\Tests\Component\Plugin\Attribute\AttributeClassDiscoveryTest::testGetPluginNamespaces()

@legacy-covers ::__construct @legacy-covers ::getPluginNamespaces

File

core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryTest.php, line 46

Class

AttributeClassDiscoveryTest
Tests Drupal\Component\Plugin\Discovery\AttributeClassDiscovery.

Namespace

Drupal\Tests\Component\Plugin\Attribute

Code

public function testGetPluginNamespaces() : void {
  // Path to the classes which we'll discover and parse annotation.
  $discovery = new AttributeClassDiscovery([
    'com/example' => [
      __DIR__,
    ],
  ]);
  $reflection = new \ReflectionMethod($discovery, 'getPluginNamespaces');
  $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.