Skip to content

Commit 398c102

Browse files
committed
fix cs
1 parent e8e4ce2 commit 398c102

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/Metadata/Property/Factory/AnnotationSubresourceMetadataFactoryTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
1515

1616
use ApiPlatform\Core\Annotation\ApiSubresource;
17+
use ApiPlatform\Core\Exception\InvalidResourceException;
1718
use ApiPlatform\Core\Metadata\Property\Factory\AnnotationSubresourceMetadataFactory;
1819
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
1920
use ApiPlatform\Core\Metadata\Property\PropertyMetadata;
@@ -58,12 +59,11 @@ public function getDependencies()
5859
];
5960
}
6061

61-
/**
62-
* @expectedException \ApiPlatform\Core\Exception\InvalidResourceException
63-
* @expectedExceptionMessage Property "relatedDummies" on resource "ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy" is declared as a subresource, but its type could not be determined.
64-
*/
6562
public function testCreatePropertyUnknownType()
6663
{
64+
$this->expectException(InvalidResourceException::class);
65+
$this->expectExceptionMessage('Property "relatedDummies" on resource "ApiPlatform\\Core\\Tests\\Fixtures\\TestBundle\\Entity\\Dummy" is declared as a subresource, but its type could not be determined.');
66+
6767
$annotation = new ApiSubresource();
6868

6969
$propertyReaderProphecy = $this->prophesize(Reader::class);
@@ -73,6 +73,6 @@ public function testCreatePropertyUnknownType()
7373
$decoratedReturnProphecy->create(Dummy::class, 'relatedDummies', [])->willReturn(new PropertyMetadata(null, 'Several dummies'))->shouldBeCalled();
7474

7575
$factory = new AnnotationSubresourceMetadataFactory($propertyReaderProphecy->reveal(), $decoratedReturnProphecy->reveal());
76-
$metadata = $factory->create(Dummy::class, 'relatedDummies');
76+
$factory->create(Dummy::class, 'relatedDummies');
7777
}
7878
}

0 commit comments

Comments
 (0)