| @@ 221-236 (lines=16) @@ | ||
| 218 | /** |
|
| 219 | * @test |
|
| 220 | */ |
|
| 221 | public function shouldRejectCallToNonExistingMethod() |
|
| 222 | { |
|
| 223 | $this->expectException(InvalidArgumentException::class); |
|
| 224 | ||
| 225 | $controller = new GenericEntityCreateController( |
|
| 226 | $this->controllerHelper, |
|
| 227 | $this->argumentBuilder, |
|
| 228 | $this->container, |
|
| 229 | [ |
|
| 230 | 'entity-class' => SampleEntity::class, |
|
| 231 | 'calls' => [ |
|
| 232 | 'doNonExistingThing' => [] |
|
| 233 | ] |
|
| 234 | ] |
|
| 235 | ); |
|
| 236 | } |
|
| 237 | ||
| 238 | /** |
|
| 239 | * @test |
|
| @@ 241-256 (lines=16) @@ | ||
| 238 | /** |
|
| 239 | * @test |
|
| 240 | */ |
|
| 241 | public function shouldRejectCallWithNonArrayParameters() |
|
| 242 | { |
|
| 243 | $this->expectException(InvalidArgumentException::class); |
|
| 244 | ||
| 245 | $controller = new GenericEntityCreateController( |
|
| 246 | $this->controllerHelper, |
|
| 247 | $this->argumentBuilder, |
|
| 248 | $this->container, |
|
| 249 | [ |
|
| 250 | 'entity-class' => SampleEntity::class, |
|
| 251 | 'calls' => [ |
|
| 252 | 'doFoo' => "notAnArray" |
|
| 253 | ] |
|
| 254 | ] |
|
| 255 | ); |
|
| 256 | } |
|
| 257 | ||
| 258 | /** |
|
| 259 | * @test |
|
| @@ 261-276 (lines=16) @@ | ||
| 258 | /** |
|
| 259 | * @test |
|
| 260 | */ |
|
| 261 | public function shouldRejectCallWithIntegerMethod() |
|
| 262 | { |
|
| 263 | $this->expectException(InvalidArgumentException::class); |
|
| 264 | ||
| 265 | $controller = new GenericEntityCreateController( |
|
| 266 | $this->controllerHelper, |
|
| 267 | $this->argumentBuilder, |
|
| 268 | $this->container, |
|
| 269 | [ |
|
| 270 | 'entity-class' => SampleEntity::class, |
|
| 271 | 'calls' => [ |
|
| 272 | 0 => [] |
|
| 273 | ] |
|
| 274 | ] |
|
| 275 | ); |
|
| 276 | } |
|
| 277 | ||
| 278 | /** |
|
| 279 | * @test |
|