Code Duplication    Length = 13-14 lines in 3 locations

tests/unit/Controllers/GenericEntityInvokeControllerTest.php 3 locations

@@ 210-223 (lines=14) @@
207
    /**
208
     * @test
209
     */
210
    public function shouldRejectNonEntityClass()
211
    {
212
        $this->expectException(InvalidArgumentException::class);
213
        $this->expectExceptionMessage('Expected an existing class name. Got: "NonExistingClass"');
214
215
        new GenericEntityInvokeController(
216
            $this->controllerHelper,
217
            $this->argumentCompiler,
218
            [
219
                'entity-class' => "NonExistingClass",
220
                'method' => 'buildRouteArguments',
221
            ]
222
        );
223
    }
224
225
    /**
226
     * @test
@@ 228-240 (lines=13) @@
225
    /**
226
     * @test
227
     */
228
    public function shouldRejectNonExistingMethod()
229
    {
230
        $this->expectException(InvalidArgumentException::class);
231
232
        new GenericEntityInvokeController(
233
            $this->controllerHelper,
234
            $this->argumentCompiler,
235
            [
236
                'entity-class' => get_class($this->argumentCompiler),
237
                'method' => 'nonExistingMethod',
238
            ]
239
        );
240
    }
241
242
    /**
243
     * @test
@@ 245-258 (lines=14) @@
242
    /**
243
     * @test
244
     */
245
    public function shouldRejectNonArrayArguments()
246
    {
247
        $this->expectException(InvalidArgumentException::class);
248
249
        new GenericEntityInvokeController(
250
            $this->controllerHelper,
251
            $this->argumentCompiler,
252
            [
253
                'entity-class' => get_class($this->argumentCompiler),
254
                'method' => 'buildRouteArguments',
255
                'arguments' => "12345",
256
            ]
257
        );
258
    }
259
260
}
261