class AnnotationBridgeDecoratorTest

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php \Drupal\Tests\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecoratorTest
  2. 10 core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php \Drupal\Tests\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecoratorTest
  3. 11.x 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

Expanded class hierarchy of AnnotationBridgeDecoratorTest

File

core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php, line 15

Namespace

Drupal\Tests\Component\Annotation\Plugin\Discovery
View source
class AnnotationBridgeDecoratorTest extends TestCase {
    
    /**
     * @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

Title Sort descending Modifiers Object type Summary
AnnotationBridgeDecoratorTest::testGetDefinitions public function @covers ::getDefinitions

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