/** * @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)); }
/** * {@inheritDoc} */ public function write($contents) { parent::write($contents); $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, ['user' => $this->read()]); }