コード例 #1
0
ファイル: DbTest.php プロジェクト: projectsmahendra/blogger
 /**
  * @covers ZfcUser\Authentication\Storage\Db::read
  */
 public function testReadWithoutResolvedEntitySetIdentityObject()
 {
     $user = $this->getMock('ZfcUser\\Entity\\User');
     $user->setUsername('zfcUser');
     $this->storage->expects($this->once())->method('read')->will($this->returnValue($user));
     $this->db->setStorage($this->storage);
     $result = $this->db->read();
     $this->assertSame($user, $result);
 }
コード例 #2
0
ファイル: Db.php プロジェクト: xelax90/skeleton-module
 public function read()
 {
     $identity = parent::read();
     /* @var $config \SkelletonApplication\Options\ZfcUserModuleOptions */
     $config = $this->getServiceManager()->get('zfcuser_module_options');
     // If userState is enabled, check if user is allowed to log in
     if ($config->getEnableUserState() && !in_array($identity->getState(), $config->getAllowedLoginStates())) {
         $this->clear();
         return $this->resolvedIdentity;
     }
     return $identity;
 }