Code Duplication    Length = 13-19 lines in 2 locations

tests/Middleware/RequestAuthenticationMiddlewareTest.php 2 locations

@@ 32-44 (lines=13) @@
29
    /**
30
     * @test
31
     */
32
    public function itAddsAHeaderWhenAuthenticationHeaderIsNotSet()
33
    {
34
        $request = new Request('GET', 'uri', []);
35
36
        $request = $this->middleware->__invoke($request);
37
38
        $headers         = [
39
            'X-Bunq-Client-Authentication' => 'session-token',
40
        ];
41
        $expectedRequest = new Request('GET', 'uri', $headers, $request->getBody());
42
43
        $this->assertEquals($expectedRequest, $request);
44
    }
45
46
    /**
47
     * @test
@@ 49-67 (lines=19) @@
46
    /**
47
     * @test
48
     */
49
    public function itDoesNotAddAHeaderWhenAuthenticationHeaderIsAlreadySet()
50
    {
51
        $request = new Request(
52
            'GET',
53
                'uri',
54
                [
55
                    'X-Bunq-Client-Authentication' => 'own-session-token',
56
                ]
57
        );
58
59
        $request = $this->middleware->__invoke($request);
60
61
        $headers         = [
62
            'X-Bunq-Client-Authentication' => 'own-session-token',
63
        ];
64
        $expectedRequest = new Request('GET', 'uri', $headers, $request->getBody());
65
66
        $this->assertEquals($expectedRequest, $request);
67
    }
68
}
69
70