<?php
namespace Symfony\Tests\Component\Config\Definition;
use Symfony\Component\Config\Definition\ArrayNode;
class ArrayNodeTest extends \PHPUnit_Framework_TestCase
{
/**
* @expectedException Symfony\Component\Config\Definition\Exception\InvalidTypeException
*/
public function testNormalizeThrowsExceptionWhenFalseIsNotAllowed()
$node = new ArrayNode('root');
$node->normalize(false);
}
* @expectedException InvalidArgumentException
public function testSetDefaultValueThrowsExceptionWhenNotAnArray()
$node->setDefaultValue('test');
* @expectedException RuntimeException
public function testSetDefaultValueThrowsExceptionWhenNotAnPrototype()
$node->setDefaultValue(array ('test'));
public function testGetDefaultValueReturnsAnEmptyArrayForPrototypes()
$prototype = new ArrayNode(null, $node);
$node->setPrototype($prototype);
$this->assertEmpty($node->getDefaultValue());
public function testGetDefaultValueReturnsDefaultValueForPrototypes()
$this->assertEquals(array ('test'), $node->getDefaultValue());