class AnnotationBridgeDecoratorTest
@coversDefaultClass \Drupal\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecorator
      
    
@group Plugin
Hierarchy
- class \Drupal\Tests\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecoratorTest uses \Prophecy\PhpUnit\ProphecyTrait extends \PHPUnit\Framework\TestCase
 
Expanded class hierarchy of AnnotationBridgeDecoratorTest
File
- 
              core/
tests/ Drupal/ Tests/ Component/ Annotation/ Plugin/ Discovery/ AnnotationBridgeDecoratorTest.php, line 18  
Namespace
Drupal\Tests\Component\Annotation\Plugin\DiscoveryView source
class AnnotationBridgeDecoratorTest extends TestCase {
  use ProphecyTrait;
  
  /**
   * @covers ::getDefinitions
   */
  public function testGetDefinitions() : void {
    $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
| Title Sort descending | Modifiers | Object type | Summary | 
|---|---|---|---|
| AnnotationBridgeDecoratorTest::testGetDefinitions | public | function | @covers ::getDefinitions[[api-linebreak]] | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.