Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lowest
  • Loading branch information
dunglas committed Jul 24, 2023
commit b567813e0a6417a462334bfb796dcaaaff7a0674
5 changes: 3 additions & 2 deletions tests/Hydra/Serializer/CollectionFiltersNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ class CollectionFiltersNormalizerTest extends TestCase
public function testSupportsNormalization(): void
{
$decoratedProphecy = $this->prophesize(NormalizerInterface::class);
$decoratedProphecy->supportsNormalization('foo', 'abc', Argument::type('array'))->willReturn(true)->shouldBeCalled();
if (method_exists(Serializer::class, 'getSupportedTypes')) {
$decoratedProphecy->getSupportedTypes(Argument::any())->willReturn(['*' => true]);
} else {
$decoratedProphecy->willImplement(CacheableSupportsMethodInterface::class);
$decoratedProphecy->hasCacheableSupportsMethod()->willReturn(true)->shouldBeCalled();
}
$decoratedProphecy->supportsNormalization('foo', 'abc', Argument::type('array'))->willReturn(true)->shouldBeCalled();

$normalizer = new CollectionFiltersNormalizer(
$decoratedProphecy->reveal(),
Expand All @@ -62,8 +62,9 @@ public function testSupportsNormalization(): void
$this->prophesize(ContainerInterface::class)->reveal()
);

$this->assertTrue($normalizer->supportsNormalization('foo', 'abc'));

if (method_exists(Serializer::class, 'getSupportedTypes')) {
$this->assertTrue($normalizer->supportsNormalization('foo', 'abc'));
$this->assertSame(['*' => true], $normalizer->getSupportedTypes('jsonld'));
} else {
$this->assertTrue($normalizer->hasCacheableSupportsMethod());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,14 @@ private function normalizePaginator(bool $partial = false, bool $cursor = false)
public function testSupportsNormalization(): void
{
$decoratedNormalizerProphecy = $this->prophesize(NormalizerInterface::class);
$decoratedNormalizerProphecy->supportsNormalization(Argument::any(), null, Argument::type('array'))->willReturn(true)->shouldBeCalled();

if (method_exists(Serializer::class, 'getSupportedTypes')) {
$decoratedNormalizerProphecy->getSupportedTypes('jsonld')->willReturn(['*' => true]);
$decoratedNormalizerProphecy->getSupportedTypes(Argument::any())->willReturn([]);
} else {
$decoratedNormalizerProphecy->willImplement(CacheableSupportsMethodInterface::class);
$decoratedNormalizerProphecy->hasCacheableSupportsMethod()->willReturn(true)->shouldBeCalled();
}
$decoratedNormalizerProphecy->supportsNormalization(Argument::any(), null, Argument::type('array'))->willReturn(true)->shouldBeCalled();

$resourceMetadataFactory = $this->prophesize(ResourceMetadataCollectionFactoryInterface::class);

Expand Down