public setDefaultValue ( string $value ) | ||
$value | string |
public function setDefaultValue($value)
{
if (!is_array($value)) {
throw new \InvalidArgumentException($this->getPath() . ': the default value of an array node has to be an array.');
}
$this->defaultValue = $value;
}
public function testGetDefaultValueReturnsDefaultValueForPrototypes() { $node = new PrototypedArrayNode('root'); $prototype = new ArrayNode(null, $node); $node->setPrototype($prototype); $node->setDefaultValue(array('test')); $this->assertEquals(array('test'), $node->getDefaultValue()); }