@@ -17,11 +17,6 @@ public function testSimpleClassToString()
1717 $ class = new PhpClassComponent ('Foo ' , true , 'stdClass ' );
1818
1919 $ class
20- ->setNamespace ('My \\Testing \\NamespaceName ' )
21- ->addUse ('My \\Testing \\ParentNamespace \\Model ' )
22- ->addUse ('My \\Testing \\ParentNamespace \\Repository ' )
23- ->addUse ('My \\Testing \\ParentNamespace \\Generator ' )
24- ->addUse ('My \\Testing \\ParentNamespace \\Foo ' , 'FooType ' )
2520 ->addAnnotationBlock ('@var string ' )
2621 ->addConstant ('FOO ' , 'theValue ' )
2722 ->addAnnotationBlock ('@var string ' )
@@ -48,7 +43,14 @@ public function testSimpleClassToString()
4843 new PhpFunctionParameterElement ('uselessParameter ' , null ),
4944 'unusedParameter '
5045 ));
51- $ file ->addClassComponent ($ class );
46+
47+ $ file
48+ ->setNamespace ('My \\Testing \\NamespaceName ' )
49+ ->addUse ('My \\Testing \\ParentNamespace \\Model ' )
50+ ->addUse ('My \\Testing \\ParentNamespace \\Repository ' )
51+ ->addUse ('My \\Testing \\ParentNamespace \\Generator ' )
52+ ->addUse ('My \\Testing \\ParentNamespace \\Foo ' , 'FooType ' , true )
53+ ->addClassComponent ($ class );
5254
5355 $ this ->assertSameContent (__FUNCTION__ , $ file );
5456 }
@@ -90,11 +92,6 @@ public function testSimpleInterfaceToString()
9092 ));
9193
9294 $ interface
93- ->setNamespace ('My \\Testing \\NamespaceName ' )
94- ->addUse ('My \\Testing \\ParentNamespace \\Model ' )
95- ->addUse ('My \\Testing \\ParentNamespace \\Repository ' )
96- ->addUse ('My \\Testing \\ParentNamespace \\Generator ' )
97- ->addUse ('My \\Testing \\ParentNamespace \\Foo ' , 'FooType ' )
9895 ->addAnnotationBlock ('@var string ' )
9996 ->addConstant ('FOO ' , 'theValue ' )
10097 ->addAnnotationBlock ('@var string ' )
@@ -121,7 +118,14 @@ public function testSimpleInterfaceToString()
121118 new PhpFunctionParameterElement ('uselessParameter ' , null ),
122119 'unusedParameter '
123120 ));
124- $ file ->addInterfaceComponent ($ interface );
121+
122+ $ file
123+ ->setNamespace ('My \\Testing \\NamespaceName ' )
124+ ->addUse ('My \\Testing \\ParentNamespace \\Model ' )
125+ ->addUse ('My \\Testing \\ParentNamespace \\Repository ' )
126+ ->addUse ('My \\Testing \\ParentNamespace \\Generator ' )
127+ ->addUse ('My \\Testing \\ParentNamespace \\Foo ' , 'FooType ' , true )
128+ ->addInterfaceComponent ($ interface );
125129
126130 $ this ->assertSameContent (__FUNCTION__ , $ file );
127131 }
0 commit comments