2121use ApiPlatform \Core \Metadata \Resource \ResourceMetadata ;
2222use ApiPlatform \Core \Metadata \Resource \ResourceNameCollection ;
2323use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \Dummy ;
24+ use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \FooDummy ;
2425use PHPUnit \Framework \TestCase ;
2526
2627/**
@@ -47,14 +48,16 @@ public function testSupportNormalization()
4748
4849 public function testNormalize ()
4950 {
50- $ collection = new ResourceNameCollection ([Dummy::class]);
51+ $ collection = new ResourceNameCollection ([FooDummy::class, Dummy::class]);
5152 $ entrypoint = new Entrypoint ($ collection );
5253
5354 $ factoryProphecy = $ this ->prophesize (ResourceMetadataFactoryInterface::class);
5455 $ factoryProphecy ->create (Dummy::class)->willReturn (new ResourceMetadata ('Dummy ' , null , null , null , ['get ' ]))->shouldBeCalled ();
56+ $ factoryProphecy ->create (FooDummy::class)->willReturn (new ResourceMetadata ('FooDummy ' , null , null , null , ['get ' ]))->shouldBeCalled ();
5557
5658 $ iriConverterProphecy = $ this ->prophesize (IriConverterInterface::class);
5759 $ iriConverterProphecy ->getIriFromResourceClass (Dummy::class)->willReturn ('/api/dummies ' )->shouldBeCalled ();
60+ $ iriConverterProphecy ->getIriFromResourceClass (FooDummy::class)->willReturn ('/api/foo_dummies ' )->shouldBeCalled ();
5861
5962 $ urlGeneratorProphecy = $ this ->prophesize (UrlGeneratorInterface::class);
6063 $ urlGeneratorProphecy ->generate ('api_entrypoint ' )->willReturn ('/api ' )->shouldBeCalled ();
@@ -67,6 +70,7 @@ public function testNormalize()
6770 '@id ' => '/api ' ,
6871 '@type ' => 'Entrypoint ' ,
6972 'dummy ' => '/api/dummies ' ,
73+ 'fooDummy ' => '/api/foo_dummies ' ,
7074 ];
7175 $ this ->assertEquals ($ expected , $ normalizer ->normalize ($ entrypoint , EntrypointNormalizer::FORMAT ));
7276 }
0 commit comments