21
21
use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \ConcreteDummy ;
22
22
use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \Dummy ;
23
23
use PHPUnit \Framework \TestCase ;
24
- use Prophecy \Argument ;
25
24
use Symfony \Component \HttpFoundation \Request ;
26
25
use Symfony \Component \HttpKernel \Event \GetResponseForControllerResultEvent ;
27
26
use Symfony \Component \HttpKernel \HttpKernelInterface ;
@@ -37,7 +36,7 @@ public function testOnKernelViewWithControllerResultAndPersist()
37
36
$ dummy ->setName ('Dummyrino ' );
38
37
39
38
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
40
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->willReturn (true )->shouldBeCalled ();
39
+ $ dataPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
41
40
$ dataPersisterProphecy ->persist ($ dummy )->willReturn ($ dummy )->shouldBeCalled ();
42
41
43
42
$ iriConverterProphecy = $ this ->prophesize (IriConverterInterface::class);
@@ -72,7 +71,7 @@ public function testOnKernelViewWithControllerResultAndPersistReturningVoid()
72
71
$ dummy ->setName ('Dummyrino ' );
73
72
74
73
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
75
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->willReturn (true )->shouldBeCalled ();
74
+ $ dataPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
76
75
$ dataPersisterProphecy ->persist ($ dummy )->shouldBeCalled ();
77
76
78
77
$ request = new Request ([], [], ['_api_resource_class ' => Dummy::class]);
@@ -105,7 +104,7 @@ public function testOnKernelViewWithControllerResultAndPersistWithImmutableResou
105
104
$ dummy2 ->setName ('Dummyferoce ' );
106
105
107
106
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
108
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->willReturn (true )->shouldBeCalled ();
107
+ $ dataPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
109
108
110
109
$ iriConverterProphecy = $ this ->prophesize (IriConverterInterface::class);
111
110
$ iriConverterProphecy ->getIriFromItem ($ dummy )->willReturn ('/dummy/1 ' )->shouldBeCalled ();
@@ -142,7 +141,7 @@ public function testOnKernelViewDoNotCallIriConverterWhenOutputClassDisabled()
142
141
$ dummy ->setName ('Dummyrino ' );
143
142
144
143
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
145
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->willReturn (true )->shouldBeCalled ();
144
+ $ dataPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
146
145
147
146
$ iriConverterProphecy = $ this ->prophesize (IriConverterInterface::class);
148
147
$ iriConverterProphecy ->getIriFromItem ($ dummy )->shouldNotBeCalled ();
@@ -171,7 +170,7 @@ public function testOnKernelViewWithControllerResultAndRemove()
171
170
$ dummy ->setName ('Dummyrino ' );
172
171
173
172
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
174
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->willReturn (true )->shouldBeCalled ();
173
+ $ dataPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
175
174
$ dataPersisterProphecy ->remove ($ dummy )->shouldBeCalled ();
176
175
177
176
$ iriConverterProphecy = $ this ->prophesize (IriConverterInterface::class);
@@ -196,7 +195,7 @@ public function testOnKernelViewWithSafeMethod()
196
195
$ dummy ->setName ('Dummyrino ' );
197
196
198
197
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
199
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->shouldNotBeCalled ();
198
+ $ dataPersisterProphecy ->supports ($ dummy )->shouldNotBeCalled ();
200
199
$ dataPersisterProphecy ->persist ($ dummy )->shouldNotBeCalled ();
201
200
$ dataPersisterProphecy ->remove ($ dummy )->shouldNotBeCalled ();
202
201
@@ -222,7 +221,7 @@ public function testOnKernelViewWithPersistFlagOff()
222
221
$ dummy ->setName ('Dummyrino ' );
223
222
224
223
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
225
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->shouldNotBeCalled ();
224
+ $ dataPersisterProphecy ->supports ($ dummy )->shouldNotBeCalled ();
226
225
$ dataPersisterProphecy ->persist ($ dummy )->shouldNotBeCalled ();
227
226
$ dataPersisterProphecy ->remove ($ dummy )->shouldNotBeCalled ();
228
227
@@ -248,7 +247,7 @@ public function testOnKernelViewWithNoResourceClass()
248
247
$ dummy ->setName ('Dummyrino ' );
249
248
250
249
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
251
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->shouldNotBeCalled ();
250
+ $ dataPersisterProphecy ->supports ($ dummy )->shouldNotBeCalled ();
252
251
$ dataPersisterProphecy ->persist ($ dummy )->shouldNotBeCalled ();
253
252
$ dataPersisterProphecy ->remove ($ dummy )->shouldNotBeCalled ();
254
253
@@ -273,7 +272,7 @@ public function testOnKernelViewWithParentResourceClass()
273
272
$ dummy = new ConcreteDummy ();
274
273
275
274
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
276
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->willReturn (true )->shouldBeCalled ();
275
+ $ dataPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
277
276
$ dataPersisterProphecy ->persist ($ dummy )->willReturn ($ dummy )->shouldBeCalled ();
278
277
279
278
$ iriConverterProphecy = $ this ->prophesize (IriConverterInterface::class);
@@ -298,7 +297,7 @@ public function testOnKernelViewWithNoDataPersisterSupport()
298
297
$ dummy ->setName ('Dummyrino ' );
299
298
300
299
$ dataPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
301
- $ dataPersisterProphecy ->supports ($ dummy, Argument:: type ( ' array ' ) )->willReturn (false )->shouldBeCalled ();
300
+ $ dataPersisterProphecy ->supports ($ dummy )->willReturn (false )->shouldBeCalled ();
302
301
$ dataPersisterProphecy ->persist ($ dummy )->shouldNotBeCalled ();
303
302
$ dataPersisterProphecy ->remove ($ dummy )->shouldNotBeCalled ();
304
303
0 commit comments