4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Config\Tests\Definition;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Config\Definition\Builder\TreeBuilder;
16 use Symfony\Component\Config\Definition\Processor;
17 use Symfony\Component\Config\Definition\NodeInterface;
19 class FinalizationTest extends TestCase
21 public function testUnsetKeyWithDeepHierarchy()
23 $tb = new TreeBuilder();
25 ->root('config', 'array')
27 ->node('level1', 'array')
30 ->node('level2', 'array')
33 ->node('somevalue', 'scalar')->end()
34 ->node('anothervalue', 'scalar')->end()
37 ->node('level1_scalar', 'scalar')->end()
49 'anothervalue' => 'bar',
51 'level1_scalar' => 'foo',
61 $this->assertEquals(array(
63 'level1_scalar' => 'foo',
65 ), $this->process($tree, array($a, $b)));
68 protected function process(NodeInterface $tree, array $configs)
70 $processor = new Processor();
72 return $processor->process($tree, $configs);