function AnnotationBridgeDecoratorTest::testGetDefinitions
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php \Drupal\Tests\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecoratorTest::testGetDefinitions()
- 10 core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php \Drupal\Tests\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecoratorTest::testGetDefinitions()
- 11.x core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php \Drupal\Tests\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecoratorTest::testGetDefinitions()
@covers ::getDefinitions
File
-
core/
tests/ Drupal/ Tests/ Component/ Annotation/ Plugin/ Discovery/ AnnotationBridgeDecoratorTest.php, line 23
Class
- AnnotationBridgeDecoratorTest
- @coversDefaultClass \Drupal\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecorator @group Plugin
Namespace
Drupal\Tests\Component\Annotation\Plugin\DiscoveryCode
public function testGetDefinitions() {
$definitions = [];
$definitions['object'] = new ObjectDefinition([
'id' => 'foo',
]);
$definitions['array'] = [
'id' => 'bar',
];
$discovery = $this->prophesize(DiscoveryInterface::class);
$discovery->getDefinitions()
->willReturn($definitions);
$decorator = new AnnotationBridgeDecorator($discovery->reveal(), TestAnnotation::class);
$expected = [
'object' => new ObjectDefinition([
'id' => 'foo',
]),
'array' => new ObjectDefinition([
'id' => 'bar',
]),
];
$this->assertEquals($expected, $decorator->getDefinitions());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.