本文整理汇总了PHP中AbstractAdapter::getIdentity方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractAdapter::getIdentity方法的具体用法?PHP AbstractAdapter::getIdentity怎么用?PHP AbstractAdapter::getIdentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractAdapter
的用法示例。
在下文中一共展示了AbstractAdapter::getIdentity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAuthenticationFails
public function testAuthenticationFails()
{
$email = 'user@example.com';
$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());
}