Exemple #1
0
 /**
  * Set a configuration value with $key.
  * $key uses the dot array syntax: parent.child.child.
  * If $value is an array this will also be accessible using the
  * dot array syntax.
  */
 public function set($key, $value)
 {
     parent::set($key, $value);
     return $this;
 }
 public function testExists()
 {
     $d = new DotArray($this->arr);
     $this->assertTrue($d->exists('one'));
     $this->assertTrue($d->exists('two.two'));
     $this->assertFalse($d->exists('foo.bar'));
     $d->set('two.two', false);
     $this->assertTrue($d->exists('two.two'));
     $d->remove('two.two');
     $this->assertFalse($d->exists('two.two'));
     $d->set('two.two', null);
     $this->assertFalse($d->exists('two.two'));
 }