Code Duplication    Length = 16-16 lines in 2 locations

tests/AuthTest.php 2 locations

@@ 132-147 (lines=16) @@
129
    }
130
    
131
    
132
    public function testLogin()
133
    {
134
        $hash = password_hash('abc', PASSWORD_BCRYPT);
135
        
136
        $user = $this->createMock(Auth\User::class);
137
        $user->method('getHashedPassword')->willReturn($hash);
138
        $user->expects($this->once())->method('onLogin');
139
        
140
        $this->auth->expects($this->once())->method('fetchUserByUsername')->with('john')->willReturn($user);
141
        $this->auth->expects($this->once())->method('persistCurrentUser');
142
        
143
        $result = $this->auth->login('john', 'abc');
144
        
145
        $this->assertSame($user, $result);
146
        $this->assertSame($user, $this->auth->user());
147
    }
148
    
149
    public function testLoginWithIncorrectPassword()
150
    {
@@ 149-164 (lines=16) @@
146
        $this->assertSame($user, $this->auth->user());
147
    }
148
    
149
    public function testLoginWithIncorrectPassword()
150
    {
151
        $hash = password_hash('abc', PASSWORD_BCRYPT);
152
        
153
        $user = $this->createMock(Auth\User::class);
154
        $user->method('getHashedPassword')->willReturn($hash);
155
        $user->expects($this->never())->method('onLogin');
156
        
157
        $this->auth->expects($this->once())->method('fetchUserByUsername')->with('john')->willReturn($user);
158
        $this->auth->expects($this->never())->method('persistCurrentUser');
159
        
160
        $result = $this->auth->login('john', 'god');
161
        
162
        $this->assertNull($result);
163
        $this->assertNull($this->auth->user());
164
    }
165
    
166
    public function testLogout()
167
    {