Code Duplication    Length = 12-18 lines in 3 locations

tests/unit/Controllers/API/GenericServiceInvokeControllerTest.php 1 location

@@ 271-288 (lines=18) @@
268
    /**
269
     * @test
270
     */
271
    public function shouldRejectCallWithoutRequest()
272
    {
273
        $this->expectException(InvalidArgumentException::class);
274
275
        $controller = new GenericServiceInvokeController(
276
            $this->controllerHelper,
277
            $this->argumentCompiler,
278
            $this->container,
279
            [
280
                'service' => 'some_service',
281
                'method' => 'doFoo',
282
            ]
283
        );
284
285
        $this->controllerHelper->method('getCurrentRequest')->willReturn(null);
286
287
        $controller();
288
    }
289
290
}
291

tests/unit/Controllers/GenericTemplateRenderControllerTest.php 2 locations

@@ 109-120 (lines=12) @@
106
    /**
107
     * @test
108
     */
109
    public function shouldRejectConstructorCalledAgain()
110
    {
111
        $this->expectException(InvalidArgumentException::class);
112
113
        $controller = new GenericTemplateRenderController($this->controllerHelper, $this->argumentCompiler, [
114
            'template' => "@foo/bar/baz.html",
115
        ]);
116
117
        $controller->__construct($this->controllerHelper, $this->argumentCompiler, [
118
            'template' => "@foo/bar/baz.html",
119
        ]);
120
    }
121
122
    /**
123
     * @test
@@ 174-186 (lines=13) @@
171
    /**
172
     * @test
173
     */
174
    public function shouldRejectCallWithoutRequest()
175
    {
176
        $this->expectException(InvalidArgumentException::class);
177
178
        $controller = new GenericTemplateRenderController($this->controllerHelper, $this->argumentCompiler, [
179
            'template' => "@foo/bar/baz.html",
180
            'arguments' => []
181
        ]);
182
183
        $this->controllerHelper->method('getCurrentRequest')->willReturn(null);
184
185
        $controller();
186
    }
187
188
}
189