public function testDelete() { DotArray::set($this->storage, 'foo.bar', 'baz'); DotArray::set($this->storage, 'foo.baz', 'qux'); DotArray::set($this->storage, 'foo.tuq', 'nux'); $this->assertEquals($this->storage['foo']['bar'], 'baz'); DotArray::delete($this->storage, 'foo.bar'); $this->assertTrue(!isset($this->storage['foo']['bar'])); $this->assertEquals($this->storage['foo']['baz'], 'qux'); DotArray::delete($this->storage, 'foo'); $this->assertTrue(!DotArray::has($this->storage, 'foo.tuq.nux')); }
/** * Destroy session, or only the given key. * @param string key * @return \Exedra\Session\Session */ public function destroy($key = null) { \Exedra\Support\DotArray::delete($this->storage, $key); return $this; }
/** * Unset config through array offset * @param string $key */ public function offsetUnset($key) { \Exedra\Support\DotArray::delete($this->storage, $key); }