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));
 }
Exemple #2
0
 /**
  * @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));
 }