|
12 | 12 | namespace Symfony\Cmf\Bundle\ResourceRestBundle\Tests\Unit\Serializer\Jms\Handler;
|
13 | 13 |
|
14 | 14 | use JMS\Serializer\Context;
|
15 |
| -use JMS\Serializer\JsonSerializationVisitor; |
| 15 | +use JMS\Serializer\GraphNavigatorInterface; |
| 16 | +use JMS\Serializer\Visitor\SerializationVisitorInterface; |
16 | 17 | use PHPUnit\Framework\TestCase;
|
17 | 18 | use Prophecy\Argument;
|
18 | 19 | use Symfony\Cmf\Bundle\ResourceRestBundle\Registry\PayloadAliasRegistry;
|
@@ -45,16 +46,19 @@ class ResourceHandlerTest extends TestCase
|
45 | 46 |
|
46 | 47 | private $description;
|
47 | 48 |
|
| 49 | + private $navigator; |
| 50 | + |
48 | 51 | protected function setUp(): void
|
49 | 52 | {
|
50 | 53 | $this->repositoryRegistry = $this->prophesize(RepositoryRegistryInterface::class);
|
51 | 54 | $this->payloadAliasRegistry = $this->prophesize(PayloadAliasRegistry::class);
|
52 |
| - $this->visitor = $this->prophesize(JsonSerializationVisitor::class); |
| 55 | + $this->visitor = $this->prophesize(SerializationVisitorInterface::class); |
53 | 56 | $this->resource = $this->prophesize(CmfResource::class);
|
54 | 57 | $this->childResource = $this->prophesize(CmfResource::class);
|
55 | 58 |
|
56 | 59 | $this->repository = $this->prophesize(ResourceRepository::class);
|
57 | 60 | $this->context = $this->prophesize(Context::class);
|
| 61 | + $this->navigator = $this->prophesize(GraphNavigatorInterface::class); |
58 | 62 |
|
59 | 63 | $this->description = $this->prophesize(Description::class);
|
60 | 64 | $this->description->all()->willReturn([]);
|
@@ -118,7 +122,8 @@ public function testHandler()
|
118 | 122 | 'descriptors' => [],
|
119 | 123 | ];
|
120 | 124 |
|
121 |
| - $this->context->accept($expected)->shouldBeCalled(); |
| 125 | + $this->context->getNavigator()->willReturn($this->navigator); |
| 126 | + $this->navigator->accept($expected)->willReturn($this->context); |
122 | 127 |
|
123 | 128 | $this->handler->serializeResource(
|
124 | 129 | $this->visitor->reveal(),
|
|
0 commit comments