public function testAuthenticationFails() { $email = '*****@*****.**'; $password = 12345678; $this->auth->expects($this->once())->method('getAdapter')->will($this->returnValue($this->adapter)); $this->auth->expects($this->once())->method('authenticate')->will($this->returnValue($this->getFailureResult())); $result = $this->authenticator->authenticate($email, $password); // Ensures identity and credential were actually set on the mock adapter $this->assertEquals($email, $this->adapter->getIdentity()); $this->assertEquals($password, $this->adapter->getCredential()); $this->assertFalse($result->isValid()); }