class AnnotationBridgeDecoratorTest in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php \Drupal\Tests\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecoratorTest
- 10 core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php \Drupal\Tests\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecoratorTest
@coversDefaultClass \Drupal\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecorator @group Plugin
Hierarchy
- class \Drupal\Tests\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecoratorTest extends \PHPUnit\Framework\TestCase uses PhpUnitCompatibilityTrait
Expanded class hierarchy of AnnotationBridgeDecoratorTest
File
- core/
tests/ Drupal/ Tests/ Component/ Annotation/ Plugin/ Discovery/ AnnotationBridgeDecoratorTest.php, line 16
Namespace
Drupal\Tests\Component\Annotation\Plugin\DiscoveryView source
class AnnotationBridgeDecoratorTest extends TestCase {
use PhpUnitCompatibilityTrait;
/**
* @covers ::getDefinitions
*/
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());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AnnotationBridgeDecoratorTest:: |
public | function | @covers ::getDefinitions |