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')); }
/** * Check whether session exist by the given key. * @param string key * @return boolean */ public function has($key) { return \Exedra\Support\DotArray::has($this->storage, $key); }
/** * Check whether given param key exists * @param string name * @return boolean */ public function hasParam($name) { return \Exedra\Support\DotArray::has($this->params, $name); }