Code Duplication    Length = 11-11 lines in 3 locations

module/Rest/test/Middleware/BodyParserMiddlewareTest.php 1 location

@@ 31-41 (lines=11) @@
28
    /**
29
     * @test
30
     */
31
    public function requestsFromOtherMethodsJustFallbackToNextMiddleware()
32
    {
33
        $request = ServerRequestFactory::fromGlobals()->withMethod('GET');
34
        $delegate = $this->prophesize(DelegateInterface::class);
35
        /** @var MethodProphecy $process */
36
        $process = $delegate->process($request)->willReturn(new Response());
37
38
        $this->middleware->process($request, $delegate->reveal());
39
40
        $process->shouldHaveBeenCalledTimes(1);
41
    }
42
43
    /**
44
     * @test

module/Rest/test/Middleware/PathVersionMiddlewareTest.php 2 locations

@@ 31-41 (lines=11) @@
28
    /**
29
     * @test
30
     */
31
    public function whenVersionIsProvidedRequestRemainsUnchanged()
32
    {
33
        $request = ServerRequestFactory::fromGlobals()->withUri(new Uri('/rest/v2/foo'));
34
35
        $delegate = $this->prophesize(DelegateInterface::class);
36
        $process = $delegate->process($request)->willReturn(new Response());
37
38
        $this->middleware->process($request, $delegate->reveal());
39
40
        $process->shouldHaveBeenCalled();
41
    }
42
43
    /**
44
     * @test
@@ 46-56 (lines=11) @@
43
    /**
44
     * @test
45
     */
46
    public function whenPathDoesNotStartWithRestRemainsUnchanged()
47
    {
48
        $request = ServerRequestFactory::fromGlobals()->withUri(new Uri('/foo'));
49
50
        $delegate = $this->prophesize(DelegateInterface::class);
51
        $process = $delegate->process($request)->willReturn(new Response());
52
53
        $this->middleware->process($request, $delegate->reveal());
54
55
        $process->shouldHaveBeenCalled();
56
    }
57
58
    /**
59
     * @test