Code Duplication    Length = 9-12 lines in 4 locations

tests/unit/Controllers/GenericEntityFetchControllerTest.php 3 locations

@@ 221-229 (lines=9) @@
218
    /**
219
     * @test
220
     */
221
    public function shouldThrowExceptionOnInvalidNormalizer()
222
    {
223
        $this->expectException(InvalidArgumentException::class);
224
225
        $controller = new GenericEntityFetchController($this->controllerHelper, [
226
            'entity-class' => SampleEntity::class,
227
            'normalizer' => false
228
        ]);
229
    }
230
231
    /**
232
     * @test
@@ 234-242 (lines=9) @@
231
    /**
232
     * @test
233
     */
234
    public function shouldThrowExceptionOnInvalidEncoder()
235
    {
236
        $this->expectException(InvalidArgumentException::class);
237
238
        $controller = new GenericEntityFetchController($this->controllerHelper, [
239
            'entity-class' => SampleEntity::class,
240
            'encoder' => false
241
        ]);
242
    }
243
244
    /**
245
     * @test
@@ 247-258 (lines=12) @@
244
    /**
245
     * @test
246
     */
247
    public function shouldThrowExceptionWhenCallingConstructorAgain()
248
    {
249
        $this->expectException(InvalidArgumentException::class);
250
251
        $controller = new GenericEntityFetchController($this->controllerHelper, [
252
            'entity-class' => SampleEntity::class,
253
        ]);
254
255
        $controller->__construct($this->controllerHelper, [
256
            'entity-class' => SampleEntity::class,
257
        ]);
258
    }
259
260
261
}

tests/unit/Controllers/GenericEntityListingControllerTest.php 1 location

@@ 52-63 (lines=12) @@
49
    /**
50
     * @test
51
     */
52
    public function shouldPreventControllerBeingCalledAgain()
53
    {
54
        $this->expectException(InvalidArgumentException::class);
55
56
        $controller = new GenericEntityListingController($this->controllerHelper, $this->argumentCompiler, [
57
            'entity-class' => SampleEntity::class
58
        ]);
59
60
        $controller->__construct($this->controllerHelper, $this->argumentCompiler, [
61
            'entity-class' => SampleEntity::class
62
        ]);
63
    }
64
65
    /**
66
     * @test