Ejemplo n.º 1
0
 public function testRemove()
 {
     $bag = new ParameterBag();
     $bag->set('A', 10);
     $this->assertTrue($bag->has('A'));
     $bag->remove('A');
     $this->assertFalse($bag->has('A'));
 }
Ejemplo n.º 2
0
 /**
  * Retrieve a configuration parameter, or throw an exception if the parameter doesn't exist
  * and there is no default value
  *
  * @see ParameterBag
  * @throws ConfigurationException If the request property doesn't exist
  */
 public function get($name, $default = null)
 {
     if (!$this->has($name) && $default === null) {
         throw new ConfigurationException(sprintf("Missing configuration parameter '%s'", $name));
     }
     return parent::get($name, $default);
 }