11<?php
2- namespace Viserio \Container \Test ;
2+ namespace Viserio \Container \Tests ;
33
44use Viserio \Container \Container ;
55use Viserio \Container \Definition ;
@@ -31,15 +31,15 @@ public function setUp()
3131 */
3232 public function testConstruct ()
3333 {
34- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Qux ' );
34+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Qux ' );
3535 $ this ->assertAttributeInstanceOf (
3636 'Viserio \\Container \\Container ' ,
3737 'container ' ,
3838 $ definition ,
3939 'The passed container name should be assigned to the $container property. '
4040 );
4141 $ this ->assertAttributeEquals (
42- 'Viserio \\Test \\Container \\Qux ' ,
42+ 'Viserio \\Tests \\Container \\Qux ' ,
4343 'class ' ,
4444 $ definition ,
4545 'The passed class name should be assigned to the $class property. '
@@ -51,10 +51,10 @@ public function testConstruct()
5151 */
5252 public function testInvokeNoArgsOrMethodCalls ()
5353 {
54- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Qux ' );
54+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Qux ' );
5555 $ instance = $ definition ();
5656 $ this ->assertInstanceOf (
57- 'Viserio \\Test \\Container \\Qux ' ,
57+ 'Viserio \\Tests \\Container \\Qux ' ,
5858 $ instance ,
5959 'Invoking the Definition class should return an instance of the class $class. '
6060 );
@@ -65,22 +65,22 @@ public function testInvokeNoArgsOrMethodCalls()
6565 */
6666 public function testInvokeWithArgs ()
6767 {
68- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Foo ' );
69- $ definition ->withArgument ('Viserio \\Test \\Container \\Bar ' )->withArgument ('Viserio \\Test \\Container \\Baz ' );
68+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Foo ' );
69+ $ definition ->withArgument ('Viserio \\Tests \\Container \\Bar ' )->withArgument ('Viserio \\Tests \\Container \\Baz ' );
7070 $ instance = $ definition ();
7171 $ this ->assertInstanceOf (
72- 'Viserio \\Test \\Container \\Foo ' ,
72+ 'Viserio \\Tests \\Container \\Foo ' ,
7373 $ instance ,
7474 'Invoking a Definition should return an instance of the class defined in the $class property. '
7575 );
7676 $ this ->assertAttributeInstanceOf (
77- 'Viserio \\Test \\Container \\Bar ' ,
77+ 'Viserio \\Tests \\Container \\Bar ' ,
7878 'bar ' ,
7979 $ instance ,
8080 'Invoking a Definition with arguments assigned should pass those args to the method. '
8181 );
8282 $ this ->assertAttributeInstanceOf (
83- 'Viserio \\Test \\Container \\Baz ' ,
83+ 'Viserio \\Tests \\Container \\Baz ' ,
8484 'baz ' ,
8585 $ instance ,
8686 'Invoking a Definition with arguments assigned should pass those args to the method. '
@@ -93,8 +93,8 @@ public function testInvokeWithArgs()
9393 public function testInvokeWithInheritedArgs ()
9494 {
9595 $ int = rand (1 , 5000 );
96- $ this ->container ->bind ('Viserio \\Test \\Container \\CorgeInterface ' )->withArgument ($ int );
97- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Corge ' );
96+ $ this ->container ->bind ('Viserio \\Tests \\Container \\CorgeInterface ' )->withArgument ($ int );
97+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Corge ' );
9898 $ instance = $ definition ();
9999 $ this ->assertAttributeEquals (
100100 $ int ,
@@ -109,11 +109,11 @@ public function testInvokeWithInheritedArgs()
109109 */
110110 public function testInvokeWithIntegerAsArg ()
111111 {
112- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Corge ' );
112+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Corge ' );
113113 $ definition ->withArgument (1 );
114114 $ instance = $ definition ();
115115 $ this ->assertInstanceOf (
116- 'Viserio \\Test \\Container \\Corge ' ,
116+ 'Viserio \\Tests \\Container \\Corge ' ,
117117 $ instance ,
118118 'Invoking a Definition should return an instance of the class defined in the $class property. '
119119 );
@@ -130,16 +130,16 @@ public function testInvokeWithIntegerAsArg()
130130 */
131131 public function testInvokeWithMethodCall ()
132132 {
133- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Qux ' );
134- $ definition ->withMethodCall ('setBar ' , ['Viserio \\Test \\Container \\Bar ' ]);
133+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Qux ' );
134+ $ definition ->withMethodCall ('setBar ' , ['Viserio \\Tests \\Container \\Bar ' ]);
135135 $ instance = $ definition ();
136136 $ this ->assertInstanceOf (
137- 'Viserio \\Test \\Container \\Qux ' ,
137+ 'Viserio \\Tests \\Container \\Qux ' ,
138138 $ instance ,
139139 'Invoking a Definition should return an instance of the class defined in the $class property. '
140140 );
141141 $ this ->assertAttributeInstanceOf (
142- 'Viserio \\Test \\Container \\Bar ' ,
142+ 'Viserio \\Tests \\Container \\Bar ' ,
143143 'bar ' ,
144144 $ instance ,
145145 'Invoking a Definition with a defined method call pass the defined args to the method. '
@@ -152,9 +152,9 @@ public function testInvokeWithMethodCall()
152152 public function testInvokeWithInheritedMethodCall ()
153153 {
154154 $ int = rand (1 , 5000 );
155- $ this ->container ->bind ('Viserio \\Test \\Container \\CorgeInterface ' )
155+ $ this ->container ->bind ('Viserio \\Tests \\Container \\CorgeInterface ' )
156156 ->withMethodCall ('setInt ' , [$ int ]);
157- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Corge ' );
157+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Corge ' );
158158 $ instance = $ definition ();
159159 $ this ->assertAttributeEquals (
160160 $ int ,
@@ -169,7 +169,7 @@ public function testInvokeWithInheritedMethodCall()
169169 */
170170 public function testWithArgument ()
171171 {
172- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Foo ' );
172+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Foo ' );
173173 $ definition ->withArgument ('foo ' );
174174 $ this ->assertAttributeContains (
175175 'foo ' ,
@@ -184,7 +184,7 @@ public function testWithArgument()
184184 */
185185 public function testAddIntegerArg ()
186186 {
187- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Foo ' );
187+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Foo ' );
188188 $ definition ->withArgument (1 );
189189 $ args = $ this ->readAttribute ($ definition , 'arguments ' );
190190 $ this ->assertEquals (
@@ -199,7 +199,7 @@ public function testAddIntegerArg()
199199 */
200200 public function testWithArguments ()
201201 {
202- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Foo ' );
202+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Foo ' );
203203 $ definition ->withArguments (['foo ' , 'bar ' ]);
204204 $ this ->assertAttributeEquals (
205205 ['foo ' , 'bar ' ],
@@ -214,7 +214,7 @@ public function testWithArguments()
214214 */
215215 public function testCleanArgs ()
216216 {
217- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Foo ' );
217+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Foo ' );
218218 $ definition ->withArguments (['foo ' , 'bar ' ]);
219219 $ definition ->cleanArgument ();
220220 $ this ->assertAttributeEquals (
@@ -227,8 +227,8 @@ public function testCleanArgs()
227227
228228 public function testWithMethod ()
229229 {
230- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Qux ' );
231- $ definition ->withMethodCall ('setBar ' , ['Viserio \\Test \\Container \\Bar ' ]);
230+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Qux ' );
231+ $ definition ->withMethodCall ('setBar ' , ['Viserio \\Tests \\Container \\Bar ' ]);
232232 $ methods = $ this ->readAttribute ($ definition , 'methods ' );
233233 $ this ->assertArrayHasKey (
234234 'setBar ' ,
@@ -239,7 +239,7 @@ public function testWithMethod()
239239
240240 public function testCallMethod ()
241241 {
242- $ definition = new Definition ($ this ->container , 'Viserio \\Test \\Container \\Corge ' );
242+ $ definition = new Definition ($ this ->container , 'Viserio \\Tests \\Container \\Corge ' );
243243 $ definition ->withMethodCall ('setInt ' , [1 ]);
244244 $ reflection = new \ReflectionMethod ($ definition , 'callMethods ' );
245245 $ reflection ->setAccessible (true );
0 commit comments