$userId = trim($userId);
try {
+ $this->_credentials['userId'] = $userId;
$this->_authenticate($userId, $credentials);
- $this->setCredential('userId', $userId);
+ $this->setCredential('userId', $this->_credentials['userId']);
$this->setCredential('credentials', $credentials);
return true;
} catch (Horde_Auth_Exception $e) {
$this->assertEquals(Horde_Auth::REASON_FAILED, $e->getCode());
}
}
+
+ public function testUidRewrite()
+ {
+ $this->kolab->expects($this->once())
+ ->method('connect')
+ ->with('user', array('password' => 'password'))
+ ->will($this->returnValue(null));
+ $this->kolab->expects($this->once())
+ ->method('getMail')
+ ->will($this->returnValue('user@example.com'));
+ $this->driver->authenticate('user', array('password' => 'password'));
+ $this->assertEquals(
+ 'user@example.com', $this->driver->getCredential('userId')
+ );
+ }
}
\ No newline at end of file