Code Duplication    Length = 15-16 lines in 2 locations

module/Rest/test/Authentication/Plugin/AuthorizationHeaderPluginTest.php 2 locations

@@ 35-50 (lines=16) @@
32
    /**
33
     * @test
34
     */
35
    public function verifyAnAuthorizationWithoutBearerTypeThrowsException()
36
    {
37
        $authToken = 'ABC-abc';
38
        $request = ServerRequestFactory::fromGlobals()->withHeader(
39
            AuthorizationHeaderPlugin::HEADER_NAME,
40
            $authToken
41
        );
42
43
        $this->expectException(VerifyAuthenticationException::class);
44
        $this->expectExceptionMessage(sprintf(
45
            'You need to provide the Bearer type in the %s header.',
46
            AuthorizationHeaderPlugin::HEADER_NAME
47
        ));
48
49
        $this->plugin->verify($request);
50
    }
51
52
    /**
53
     * @test
@@ 55-69 (lines=15) @@
52
    /**
53
     * @test
54
     */
55
    public function verifyAnAuthorizationWithWrongTypeThrowsException()
56
    {
57
        $authToken = 'Basic ABC-abc';
58
        $request = ServerRequestFactory::fromGlobals()->withHeader(
59
            AuthorizationHeaderPlugin::HEADER_NAME,
60
            $authToken
61
        );
62
63
        $this->expectException(VerifyAuthenticationException::class);
64
        $this->expectExceptionMessage(
65
            'Provided authorization type Basic is not supported. Use Bearer instead.'
66
        );
67
68
        $this->plugin->verify($request);
69
    }
70
71
    /**
72
     * @test