Esempio n. 1
0
 public function testGetDefaultValueReturnsDefaultValueForPrototypes()
 {
     $node = new ArrayNode('root');
     $prototype = new ArrayNode(null, $node);
     $node->setPrototype($prototype);
     $node->setDefaultValue(array('test'));
     $this->assertEquals(array('test'), $node->getDefaultValue());
 }
Esempio n. 2
0
 /**
  * @expectedException \RuntimeException
  * @expectedExceptionMessage The node at path "foo" has no default value.
  */
 public function testGetDefaultValueWithoutDefaultValue()
 {
     $node = new ArrayNode('foo');
     $node->getDefaultValue();
 }
Esempio n. 3
0
 public function getDefaultValue()
 {
     if ($this->children['type']->getDefaultValue()) {
         $this->prepareChildren($this->children['type']->getDefaultValue());
     }
     return parent::getDefaultValue();
 }