1212namespace Symfony \Component \Config \Tests \Definition \Builder ;
1313
1414use PHPUnit \Framework \TestCase ;
15+ use Symfony \Component \Config \Definition \BaseNode ;
16+ use Symfony \Component \Config \Definition \BooleanNode ;
17+ use Symfony \Component \Config \Definition \Builder \BooleanNodeDefinition ;
1518use Symfony \Component \Config \Definition \Builder \TreeBuilder ;
19+ use Symfony \Component \Config \Tests \Fixtures \BarNode ;
20+ use Symfony \Component \Config \Tests \Fixtures \Builder \BarNodeDefinition ;
1621use Symfony \Component \Config \Tests \Fixtures \Builder \NodeBuilder as CustomNodeBuilder ;
22+ use Symfony \Component \Config \Tests \Fixtures \Builder \VariableNodeDefinition ;
1723
1824class TreeBuilderTest extends TestCase
1925{
@@ -23,11 +29,11 @@ public function testUsingACustomNodeBuilder()
2329
2430 $ nodeBuilder = $ builder ->getRootNode ()->children ();
2531
26- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Tests \ Fixtures \ Builder \NodeBuilder ::class, $ nodeBuilder );
32+ $ this ->assertInstanceOf (CustomNodeBuilder ::class, $ nodeBuilder );
2733
2834 $ nodeBuilder = $ nodeBuilder ->arrayNode ('deeper ' )->children ();
2935
30- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Tests \ Fixtures \ Builder \NodeBuilder ::class, $ nodeBuilder );
36+ $ this ->assertInstanceOf (CustomNodeBuilder ::class, $ nodeBuilder );
3137 }
3238
3339 public function testOverrideABuiltInNodeType ()
@@ -36,7 +42,7 @@ public function testOverrideABuiltInNodeType()
3642
3743 $ definition = $ builder ->getRootNode ()->children ()->variableNode ('variable ' );
3844
39- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Tests \ Fixtures \ Builder \ VariableNodeDefinition::class, $ definition );
45+ $ this ->assertInstanceOf (VariableNodeDefinition::class, $ definition );
4046 }
4147
4248 public function testAddANodeType ()
@@ -45,7 +51,7 @@ public function testAddANodeType()
4551
4652 $ definition = $ builder ->getRootNode ()->children ()->barNode ('variable ' );
4753
48- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Tests \ Fixtures \ Builder \ BarNodeDefinition::class, $ definition );
54+ $ this ->assertInstanceOf (BarNodeDefinition::class, $ definition );
4955 }
5056
5157 public function testCreateABuiltInNodeTypeWithACustomNodeBuilder ()
@@ -54,7 +60,7 @@ public function testCreateABuiltInNodeTypeWithACustomNodeBuilder()
5460
5561 $ definition = $ builder ->getRootNode ()->children ()->booleanNode ('boolean ' );
5662
57- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Definition \ Builder \ BooleanNodeDefinition::class, $ definition );
63+ $ this ->assertInstanceOf (BooleanNodeDefinition::class, $ definition );
5864 }
5965
6066 public function testPrototypedArrayNodeUseTheCustomNodeBuilder ()
@@ -64,7 +70,7 @@ public function testPrototypedArrayNodeUseTheCustomNodeBuilder()
6470 $ root = $ builder ->getRootNode ();
6571 $ root ->prototype ('bar ' )->end ();
6672
67- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Tests \ Fixtures \ BarNode::class, $ root ->getNode (true )->getPrototype ());
73+ $ this ->assertInstanceOf (BarNode::class, $ root ->getNode (true )->getPrototype ());
6874 }
6975
7076 public function testAnExtendedNodeBuilderGetsPropagatedToTheChildren ()
@@ -86,11 +92,11 @@ public function testAnExtendedNodeBuilderGetsPropagatedToTheChildren()
8692 $ node = $ builder ->buildTree ();
8793 $ children = $ node ->getChildren ();
8894
89- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Definition \ BooleanNode::class, $ children ['foo ' ]);
95+ $ this ->assertInstanceOf (BooleanNode::class, $ children ['foo ' ]);
9096
9197 $ childChildren = $ children ['child ' ]->getChildren ();
9298
93- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Definition \ BooleanNode::class, $ childChildren ['foo ' ]);
99+ $ this ->assertInstanceOf (BooleanNode::class, $ childChildren ['foo ' ]);
94100 }
95101
96102 public function testDefinitionInfoGetsTransferredToNode ()
@@ -147,14 +153,14 @@ public function testDefaultPathSeparatorIsDot()
147153 $ children = $ node ->getChildren ();
148154
149155 $ this ->assertArrayHasKey ('foo ' , $ children );
150- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Definition \ BaseNode::class, $ children ['foo ' ]);
156+ $ this ->assertInstanceOf (BaseNode::class, $ children ['foo ' ]);
151157 $ this ->assertSame ('propagation.foo ' , $ children ['foo ' ]->getPath ());
152158
153159 $ this ->assertArrayHasKey ('child ' , $ children );
154160 $ childChildren = $ children ['child ' ]->getChildren ();
155161
156162 $ this ->assertArrayHasKey ('foo ' , $ childChildren );
157- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Definition \ BaseNode::class, $ childChildren ['foo ' ]);
163+ $ this ->assertInstanceOf (BaseNode::class, $ childChildren ['foo ' ]);
158164 $ this ->assertSame ('propagation.child.foo ' , $ childChildren ['foo ' ]->getPath ());
159165 }
160166
@@ -178,14 +184,14 @@ public function testPathSeparatorIsPropagatedToChildren()
178184 $ children = $ node ->getChildren ();
179185
180186 $ this ->assertArrayHasKey ('foo ' , $ children );
181- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Definition \ BaseNode::class, $ children ['foo ' ]);
187+ $ this ->assertInstanceOf (BaseNode::class, $ children ['foo ' ]);
182188 $ this ->assertSame ('propagation/foo ' , $ children ['foo ' ]->getPath ());
183189
184190 $ this ->assertArrayHasKey ('child ' , $ children );
185191 $ childChildren = $ children ['child ' ]->getChildren ();
186192
187193 $ this ->assertArrayHasKey ('foo ' , $ childChildren );
188- $ this ->assertInstanceOf (\ Symfony \ Component \ Config \ Definition \ BaseNode::class, $ childChildren ['foo ' ]);
194+ $ this ->assertInstanceOf (BaseNode::class, $ childChildren ['foo ' ]);
189195 $ this ->assertSame ('propagation/child/foo ' , $ childChildren ['foo ' ]->getPath ());
190196 }
191197}
0 commit comments