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
more fixes
  • Loading branch information
dunglas committed Jul 24, 2023
commit 7ec4f6d5693b90be328605982356488fd906aa84
2 changes: 1 addition & 1 deletion src/OpenApi/Tests/Serializer/ApiGatewayNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
use ApiPlatform\OpenApi\Model\Paths;
use ApiPlatform\OpenApi\OpenApi;
use ApiPlatform\OpenApi\Serializer\ApiGatewayNormalizer;
use ApiPlatform\OpenApi\Serializer\CacheableSupportsMethodInterface;
use ApiPlatform\OpenApi\Serializer\OpenApiNormalizer;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Serializer;

Expand Down
25 changes: 11 additions & 14 deletions tests/Elasticsearch/Serializer/ItemNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

use ApiPlatform\Elasticsearch\Serializer\DocumentNormalizer;
use ApiPlatform\Elasticsearch\Serializer\ItemNormalizer;
use ApiPlatform\Serializer\CacheableSupportsMethodInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Serializer\Exception\LogicException;
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Serializer;
Expand All @@ -35,15 +35,16 @@ final class ItemNormalizerTest extends TestCase

protected function setUp(): void
{
$this->itemNormalizer = new ItemNormalizer(
(
$this->normalizerProphecy = $this
->prophesize(NormalizerInterface::class)
->willImplement(DenormalizerInterface::class)
->willImplement(SerializerAwareInterface::class)
->willImplement(CacheableSupportsMethodInterface::class)
)->reveal()
);
$this->normalizerProphecy = $this
->prophesize(NormalizerInterface::class)
->willImplement(DenormalizerInterface::class)
->willImplement(SerializerAwareInterface::class);

if (!method_exists(Serializer::class, 'getSupportedTypes')) {
$this->normalizerProphecy->willImplement(CacheableSupportsMethodInterface::class);
}

$this->itemNormalizer = new ItemNormalizer($this->normalizerProphecy->reveal());
}

public function testConstruct(): void
Expand Down Expand Up @@ -111,10 +112,6 @@ public function testSetSerializer(): void
*/
public function testHasCacheableSupportsMethodWithDecoratedNormalizerNotAnInstanceOfCacheableSupportsMethodInterface(): void
{
if (method_exists(Serializer::class, 'getSupportedTypes')) {
$this->markTestSkipped('Symfony Serializer >= 6.3');
}

$this->expectException(LogicException::class);
$this->expectExceptionMessage(sprintf('The decorated normalizer must be an instance of "%s".', CacheableSupportsMethodInterface::class));

Expand Down