PHP Class Symfony\Component\Config\Tests\Definition\PrototypedArrayNodeTest

Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: symfony/symfony

Public Methods

Method Description
getDataForKeyRemovedLeftValueOnly ( )
testAddDefaultChildren ( )
testDefaultChildrenWinsOverDefaultValue ( )
testGetDefaultValueReturnsAnEmptyArrayForPrototypes ( )
testGetDefaultValueReturnsDefaultValueForPrototypes ( )
testMappedAttributeKeyIsRemoved ( ) Tests that when a key attribute is mapped, that key is removed from the array.
testMappedAttributeKeyIsRemovedLeftValueOnly ( $value, $children, $expected ) Tests that when a key attribute is mapped, that key is removed from the array.
testMappedAttributeKeyNotRemoved ( ) Tests the opposite of the testMappedAttributeKeyIsRemoved because the removal can be toggled with an option.
testRemappedKeysAreUnset ( ) a remapped key (e.g. "mapping" -> "mappings") should be unset after being used

Protected Methods

Method Description
getPrototypeNodeWithDefaultChildren ( )

Method Details

getDataForKeyRemovedLeftValueOnly() public method

getPrototypeNodeWithDefaultChildren() protected method

testAddDefaultChildren() public method

testDefaultChildrenWinsOverDefaultValue() public method

testGetDefaultValueReturnsAnEmptyArrayForPrototypes() public method

testGetDefaultValueReturnsDefaultValueForPrototypes() public method

testMappedAttributeKeyIsRemoved() public method

The above should finally be mapped to an array that looks like this (because "id" is the key attribute). array( 'things' => array( 'option1' => 'foo', 'option2' => 'bar', ) )

testMappedAttributeKeyIsRemovedLeftValueOnly() public method

And if only 'value' element is left in the array, it will replace its wrapper array. The above should finally be mapped to an array that looks like this (because "id" is the key attribute). array( 'things' => array( 'option1' => 'value1' ) ) It's also possible to mix 'value-only' and 'non-value-only' elements in the array. The above should finally be mapped to an array as follows array( 'things' => array( 'option1' => 'value1', 'option2' => array( 'value' => 'value2', 'foo' => 'foo2' ) ) ) The 'value' element can also be ArrayNode: The above should be finally be mapped to an array as follows array( 'things' => array( 'option1' => array( 'foo' => 'foo1', 'bar' => 'bar1' ) ) ) If using VariableNode for value node, it's also possible to mix different types of value nodes: The above should be finally mapped to an array as follows array( 'things' => array( 'option1' => array( 'foo' => 'foo1', 'bar' => 'bar1' ), 'option2' => 'value2' ) )
public testMappedAttributeKeyIsRemovedLeftValueOnly ( $value, $children, $expected )

testMappedAttributeKeyNotRemoved() public method

Tests the opposite of the testMappedAttributeKeyIsRemoved because the removal can be toggled with an option.

testRemappedKeysAreUnset() public method

a remapped key (e.g. "mapping" -> "mappings") should be unset after being used