Code Duplication    Length = 11-11 lines in 2 locations

src/Tests/Authenticator/AuthenticatorTest.php 2 locations

@@ 188-198 (lines=11) @@
185
    /**
186
     * @test
187
     */
188
    public function willAddRolesFromAudienceClaimsInToken()
189
    {
190
        $authenticator = new Authenticator($this->keys);
191
        $token         = $this->createToken(['aud' => 'guests']);
192
        $user          = new RoleAssignanleUser('john', 'hi there');
193
        $token         = new PreAuthenticatedToken($user, $token, 'providerkey');
194
195
        $result = $authenticator->setUserRolesFromAudienceClaims($user, $token);
196
197
        $this->assertEquals(['guests'], $result->getRoles());
198
    }
199
200
    /**
201
     * @test
@@ 218-228 (lines=11) @@
215
    /**
216
     * @test
217
     */
218
    public function willNotAssignRolesIfUserClassHasNoAddRoleMethod()
219
    {
220
        $authenticator = new Authenticator($this->keys);
221
        $token         = $this->createToken(['aud' => 'guests']);
222
        $user          = new User('john', 'hi there');
223
        $token         = new PreAuthenticatedToken($user, $token, 'providerkey');
224
225
        $result = $authenticator->setUserRolesFromAudienceClaims($user, $token);
226
227
        $this->assertEquals([], $result->getRoles());
228
    }
229
230
    /**
231
     * @param array $claims