@@ -54,7 +54,7 @@ public function testProvide(): void
54
54
new ApiResource (operations: [$ parentOperation ]),
55
55
])
56
56
);
57
- $ decorated ->provide ($ parentOperation , $ uriVariables )->shouldBeCalled ()->willReturn (new Company ());
57
+ $ decorated ->provide ($ parentOperation , $ uriVariables, [] )->shouldBeCalled ()->willReturn (new Company ());
58
58
59
59
$ createProvider = new CreateProvider ($ decorated ->reveal (), $ resourceMetadataCollectionFactory ->reveal ());
60
60
$ createProvider ->provide ($ operation , $ uriVariables );
@@ -78,7 +78,7 @@ public function testProvideParentNotFound(): void
78
78
new ApiResource (operations: [$ parentOperation ]),
79
79
])
80
80
);
81
- $ decorated ->provide ($ parentOperation , $ uriVariables )->shouldBeCalled ()->willReturn (null );
81
+ $ decorated ->provide ($ parentOperation , $ uriVariables, [] )->shouldBeCalled ()->willReturn (null );
82
82
83
83
$ this ->expectException (NotFoundHttpException::class);
84
84
@@ -104,7 +104,7 @@ public function testProvideParentProviderNotFound(): void
104
104
new ApiResource (operations: [$ parentOperation ]),
105
105
])
106
106
);
107
- $ decorated ->provide ($ parentOperation , $ uriVariables )->shouldBeCalled ()->willThrow (ProviderNotFoundException::class);
107
+ $ decorated ->provide ($ parentOperation , $ uriVariables, [] )->shouldBeCalled ()->willThrow (ProviderNotFoundException::class);
108
108
109
109
$ this ->expectException (NotFoundHttpException::class);
110
110
@@ -127,7 +127,7 @@ class: Employee::class,
127
127
$ parentOperation = new Get (uriVariables: ['id ' => $ link ], class: Company::class);
128
128
129
129
$ resourceMetadataCollectionFactory ->create (Company::class)->shouldBeCalledOnce ()->willThrow (ResourceClassNotFoundException::class);
130
- $ decorated ->provide ($ parentOperation , $ uriVariables )->shouldNotBeCalled ();
130
+ $ decorated ->provide ($ parentOperation , $ uriVariables, [] )->shouldNotBeCalled ();
131
131
132
132
$ this ->expectException (ResourceClassNotFoundException::class);
133
133
@@ -157,7 +157,7 @@ class: Employee::class,
157
157
new ApiResource (),
158
158
])
159
159
);
160
- $ decorated ->provide ($ parentOperation , $ uriVariables )->shouldNotBeCalled ();
160
+ $ decorated ->provide ($ parentOperation , $ uriVariables, [] )->shouldNotBeCalled ();
161
161
162
162
$ this ->expectException (OperationNotFoundException::class);
163
163
@@ -191,7 +191,7 @@ class: Employee::class,
191
191
]),
192
192
])
193
193
);
194
- $ decorated ->provide ($ parentOperation , $ uriVariables )->shouldBeCalled ()->willReturn (new Company ());
194
+ $ decorated ->provide ($ parentOperation , $ uriVariables, [] )->shouldBeCalled ()->willReturn (new Company ());
195
195
196
196
$ createProvider = new CreateProvider ($ decorated ->reveal (), $ resourceMetadataCollectionFactory ->reveal ());
197
197
$ createProvider ->provide ($ operation , $ uriVariables );
@@ -215,7 +215,7 @@ public function testProvideFailsProperlyOnComplexConstructor(): void
215
215
new ApiResource (operations: [$ parentOperation ]),
216
216
])
217
217
);
218
- $ decorated ->provide ($ parentOperation , $ uriVariables )->shouldBeCalled ()->willReturn (new Company ());
218
+ $ decorated ->provide ($ parentOperation , $ uriVariables, [] )->shouldBeCalled ()->willReturn (new Company ());
219
219
220
220
$ this ->expectException (RuntimeException::class);
221
221
$ this ->expectExceptionMessage ('An error occurred while trying to create an instance of the "ApiPlatform\Tests\Fixtures\TestBundle\Entity\DummyResourceWithComplexConstructor" resource. Consider writing your own "ApiPlatform\State\ProviderInterface" implementation and setting it as `provider` on your operation instead. ' );
0 commit comments