本文整理汇总了PHP中storage::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP storage::expects方法的具体用法?PHP storage::expects怎么用?PHP storage::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类storage
的用法示例。
在下文中一共展示了storage::expects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setAuthenticationCredentials
protected function setAuthenticationCredentials($identity = 'ZfcUser', $credential = 'ZfcUserPassword')
{
$this->storage->expects($this->at(0))->method('read')->will($this->returnValue(array('is_satisfied' => false)));
$post = $this->getMock('Zend\\Stdlib\\Parameters');
$post->expects($this->at(0))->method('get')->with('identity')->will($this->returnValue($identity));
$post->expects($this->at(1))->method('get')->with('credential')->will($this->returnValue($credential));
$request = $this->getMock('Zend\\Http\\Request');
$request->expects($this->exactly(2))->method('getPost')->will($this->returnValue($post));
$this->authEvent->expects($this->exactly(2))->method('getRequest')->will($this->returnValue($request));
}
示例2: testClear
/**
* @covers ZfcUser\Authentication\Storage\Db::clear
*/
public function testClear()
{
$reflectionClass = new \ReflectionClass('ZfcUser\\Authentication\\Storage\\Db');
$reflectionProperty = $reflectionClass->getProperty('resolvedIdentity');
$reflectionProperty->setAccessible(true);
$this->storage->expects($this->once())->method('clear');
$this->db->setStorage($this->storage);
$this->db->clear();
$this->assertNull($reflectionProperty->getValue($this->db));
}