Skip to content

Commit 8e352c4

Browse files
committed
test: fix MongoDB tests for RPC
1 parent 93e45fc commit 8e352c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/Fixtures/TestBundle/DataTransformer/RPCOutputDataTransformer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use ApiPlatform\Core\DataTransformer\DataTransformerInterface;
1717
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Dto\RPCOutput;
18+
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Document\RPC as RPCDocument;
1819
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\RPC;
1920

2021
final class RPCOutputDataTransformer implements DataTransformerInterface
@@ -32,6 +33,6 @@ public function transform($object, string $to, array $context = [])
3233
*/
3334
public function supportsTransformation($object, string $to, array $context = []): bool
3435
{
35-
return $object instanceof RPC && RPCOutput::class === $to;
36+
return ($object instanceof RPC || $object instanceof RPCDocument) && RPCOutput::class === $to;
3637
}
3738
}

0 commit comments

Comments
 (0)