@@ 172-185 (lines=14) @@ | ||
169 | /** |
|
170 | * @test |
|
171 | */ |
|
172 | public function shouldRejectNonEntityClass() |
|
173 | { |
|
174 | $this->expectException(InvalidArgumentException::class); |
|
175 | $this->expectExceptionMessage('Expected an existing class name. Got: "NonExistingClass"'); |
|
176 | ||
177 | new GenericEntityInvokeController( |
|
178 | $this->controllerHelper, |
|
179 | $this->argumentCompiler, |
|
180 | [ |
|
181 | 'entity-class' => "NonExistingClass", |
|
182 | 'method' => 'buildRouteArguments', |
|
183 | ] |
|
184 | ); |
|
185 | } |
|
186 | ||
187 | /** |
|
188 | * @test |
|
@@ 190-202 (lines=13) @@ | ||
187 | /** |
|
188 | * @test |
|
189 | */ |
|
190 | public function shouldRejectNonExistingMethod() |
|
191 | { |
|
192 | $this->expectException(InvalidArgumentException::class); |
|
193 | ||
194 | new GenericEntityInvokeController( |
|
195 | $this->controllerHelper, |
|
196 | $this->argumentCompiler, |
|
197 | [ |
|
198 | 'entity-class' => get_class($this->argumentCompiler), |
|
199 | 'method' => 'nonExistingMethod', |
|
200 | ] |
|
201 | ); |
|
202 | } |
|
203 | ||
204 | /** |
|
205 | * @test |
|
@@ 207-220 (lines=14) @@ | ||
204 | /** |
|
205 | * @test |
|
206 | */ |
|
207 | public function shouldRejectNonArrayArguments() |
|
208 | { |
|
209 | $this->expectException(InvalidArgumentException::class); |
|
210 | ||
211 | new GenericEntityInvokeController( |
|
212 | $this->controllerHelper, |
|
213 | $this->argumentCompiler, |
|
214 | [ |
|
215 | 'entity-class' => get_class($this->argumentCompiler), |
|
216 | 'method' => 'buildRouteArguments', |
|
217 | 'arguments' => "12345", |
|
218 | ] |
|
219 | ); |
|
220 | } |
|
221 | ||
222 | } |
|
223 |