コード例 #1
0
ファイル: DbTest.php プロジェクト: projectsmahendra/blogger
 /**
  * @covers ZfcUser\Authentication\Storage\Db::write
  */
 public function testWrite()
 {
     $reflectionClass = new \ReflectionClass('ZfcUser\\Authentication\\Storage\\Db');
     $reflectionProperty = $reflectionClass->getProperty('resolvedIdentity');
     $reflectionProperty->setAccessible(true);
     $this->storage->expects($this->once())->method('write')->with('zfcUser');
     $this->db->setStorage($this->storage);
     $this->db->write('zfcUser');
     $this->assertNull($reflectionProperty->getValue($this->db));
 }
コード例 #2
0
ファイル: Db.php プロジェクト: hale0124/zf2-starter-template
 /**
  * {@inheritDoc}
  */
 public function write($contents)
 {
     parent::write($contents);
     $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, ['user' => $this->read()]);
 }