@@ -18,11 +18,7 @@ class PartialNodeTest extends TestCase
1818 public function it_strips_children_that_are_not_in_the_given_path_with_one_name ()
1919 {
2020 $ treeBuilder = new TreeBuilder ('root ' );
21- if (method_exists ($ treeBuilder , 'getRootNode ' )) {
22- $ root = $ treeBuilder ->getRootNode ();
23- } else {
24- $ root = $ treeBuilder ->root ('root ' );
25- }
21+ $ root = $ treeBuilder ->getRootNode ();
2622 $ root
2723 ->children ()
2824 ->arrayNode ('node_1 ' )
@@ -49,11 +45,7 @@ public function it_strips_children_that_are_not_in_the_given_path_with_one_name(
4945 public function it_strips_children_that_are_not_in_the_given_path_with_several_names ()
5046 {
5147 $ treeBuilder = new TreeBuilder ('root ' );
52- if (method_exists ($ treeBuilder , 'getRootNode ' )) {
53- $ root = $ treeBuilder ->getRootNode ();
54- } else {
55- $ root = $ treeBuilder ->root ('root ' );
56- }
48+ $ root = $ treeBuilder ->getRootNode ();
5749 $ root
5850 ->children ()
5951 ->arrayNode ('node_1 ' )
@@ -91,11 +83,7 @@ public function it_strips_children_that_are_not_in_the_given_path_with_several_n
9183 public function it_strips_children_when_leaf_node_is_not_an_array ()
9284 {
9385 $ treeBuilder = new TreeBuilder ('root ' );
94- if (method_exists ($ treeBuilder , 'getRootNode ' )) {
95- $ root = $ treeBuilder ->getRootNode ();
96- } else {
97- $ root = $ treeBuilder ->root ('root ' );
98- }
86+ $ root = $ treeBuilder ->getRootNode ();
9987 $ root
10088 ->children ()
10189 ->arrayNode ('node_1 ' )
@@ -122,11 +110,7 @@ public function it_strips_children_when_leaf_node_is_not_an_array()
122110 public function it_does_not_crash_on_prototypes ()
123111 {
124112 $ treeBuilder = new TreeBuilder ('root ' );
125- if (method_exists ($ treeBuilder , 'getRootNode ' )) {
126- $ root = $ treeBuilder ->getRootNode ();
127- } else {
128- $ root = $ treeBuilder ->root ('root ' );
129- }
113+ $ root = $ treeBuilder ->getRootNode ();
130114 $ root
131115 ->prototype ('array ' )
132116 ->children ()
@@ -156,11 +140,7 @@ public function it_does_not_crash_on_prototypes()
156140 public function it_fails_when_a_requested_child_node_does_not_exist ()
157141 {
158142 $ treeBuilder = new TreeBuilder ('root ' );
159- if (method_exists ($ treeBuilder , 'getRootNode ' )) {
160- $ root = $ treeBuilder ->getRootNode ();
161- } else {
162- $ root = $ treeBuilder ->root ('root ' );
163- }
143+ $ root = $ treeBuilder ->getRootNode ();
164144 $ root
165145 ->children ()
166146 ->arrayNode ('sub_node ' )
@@ -181,11 +161,7 @@ public function it_fails_when_a_requested_child_node_does_not_exist()
181161 public function it_fails_when_a_requested_child_node_is_no_array_node_itself_and_path_not_empty ()
182162 {
183163 $ treeBuilder = new TreeBuilder ('root ' );
184- if (method_exists ($ treeBuilder , 'getRootNode ' )) {
185- $ root = $ treeBuilder ->getRootNode ();
186- } else {
187- $ root = $ treeBuilder ->root ('root ' );
188- }
164+ $ root = $ treeBuilder ->getRootNode ();
189165 $ root
190166 ->children ()
191167 ->arrayNode ('sub_node ' )
@@ -203,7 +179,6 @@ public function it_fails_when_a_requested_child_node_is_no_array_node_itself_and
203179 private function nodeOnlyHasChild (ArrayNode $ node , $ nodeName )
204180 {
205181 $ property = new \ReflectionProperty ($ node , 'children ' );
206- $ property ->setAccessible (true );
207182 $ children = $ property ->getValue ($ node );
208183
209184 $ this ->assertCount (1 , $ children );
0 commit comments