Code Duplication    Length = 11-12 lines in 2 locations

tests/unit/CreateTokenMutationCreatorTest.php 2 locations

@@ 43-54 (lines=12) @@
40
        $this->assertNotNull($response->Token);
41
    }
42
43
    public function testResolveInvalidWithAllowedAnonymous()
44
    {
45
        Config::modify()->set(JWTAuthenticator::class, 'anonymous_allowed', true);
46
        $authenticator = Injector::inst()->get(CreateTokenMutationCreator::class);
47
48
        $response = $authenticator->resolve(null, ['Email' => '[email protected]', 'Password' => 'wrong'], [],
49
            new ResolveInfo([]));
50
51
        $this->assertTrue($response instanceof Member);
52
        $this->assertEquals(0, $response->ID);
53
        $this->assertNotNull($response->Token);
54
    }
55
56
    public function testResolveInvalidWithoutAllowedAnonymous()
57
    {
@@ 56-66 (lines=11) @@
53
        $this->assertNotNull($response->Token);
54
    }
55
56
    public function testResolveInvalidWithoutAllowedAnonymous()
57
    {
58
        Config::modify()->set(JWTAuthenticator::class, 'anonymous_allowed', false);
59
        $authenticator = Injector::inst()->get(CreateTokenMutationCreator::class);
60
61
        $response = $authenticator->resolve(null, ['Email' => '[email protected]', 'Password' => 'wrong'], [],
62
            new ResolveInfo([]));
63
64
        $this->assertTrue($response instanceof Member);
65
        $this->assertNull($response->Token);
66
    }
67
}
68