Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DependencyInjection] Adding a NodeBuilder::addNodeBuilder() method t…
…hat helps achieve a fluid interface when a pre-built NodeBuilder needs to be added.
- Loading branch information
1 parent
f5b1cb1
commit bd15ddd
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tests/Symfony/Tests/Component/DependencyInjection/Configuration/Builder/NodeBuilderTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Symfony\Tests\Component\DependencyInjection\Configuration; | ||
|
||
use Symfony\Component\DependencyInjection\Configuration\Builder\NodeBuilder; | ||
|
||
class NodeBuilderTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testAddNodeBuilder() | ||
{ | ||
$nodeBuilder = new NodeBuilder('root', array()); | ||
$childNode = new NodeBuilder('child', array()); | ||
|
||
$ret = $nodeBuilder->addNodeBuilder($childNode); | ||
$this->assertEquals(array('child' => $childNode), $nodeBuilder->children); | ||
$this->assertEquals($nodeBuilder, $ret); | ||
} | ||
} |