Ejemplo n.º 1
0
 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'));
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * Check whether given param key exists
  * @param string name
  * @return boolean
  */
 public function hasParam($name)
 {
     return \Exedra\Support\DotArray::has($this->params, $name);
 }