@@ -29,112 +29,6 @@ protected function tearDown()
2929 {
3030 }
3131
32- /**
33- * @covers Route::explode
34- * @todo Implement testExplode().
35- */
36- public function testSlashExplode ()
37- {
38- $ this ->markTestSkipped ("Check if is router test " );
39- $ routeObj = $ this ->object ->explode ("/ " );
40-
41- $ route = $ routeObj ->getRoute ();
42- $ params = $ routeObj ->getParams ();
43-
44- $ this ->assertEquals ("Index " , $ route ["controller " ]);
45- $ this ->assertEquals ("index " , $ route ["action " ]);
46-
47- $ this ->assertInternalType ("array " , $ params );
48- $ this ->assertSame (0 , count ($ params ));
49- }
50-
51- public function testOnlyActionExplode ()
52- {
53- $ this ->markTestSkipped ("Check if is router test " );
54- $ routeObj = $ this ->object ->explode ("/home " );
55-
56- $ route = $ routeObj ->getRoute ();
57- $ params = $ routeObj ->getParams ();
58-
59- $ this ->assertEquals ("Index " , $ route ["controller " ]);
60- $ this ->assertEquals ("home " , $ route ["action " ]);
61-
62- $ this ->assertInternalType ("array " , $ params );
63- $ this ->assertSame (0 , count ($ params ));
64- }
65-
66- public function testControllerActionExplode ()
67- {
68- $ this ->markTestSkipped ("Check if is router test " );
69- $ routeObj = $ this ->object ->explode ("/admin/home " );
70-
71- $ route = $ routeObj ->getRoute ();
72- $ params = $ routeObj ->getParams ();
73-
74- $ this ->assertEquals ("Admin " , $ route ["controller " ]);
75- $ this ->assertEquals ("home " , $ route ["action " ]);
76-
77- $ this ->assertInternalType ("array " , $ params );
78- $ this ->assertSame (0 , count ($ params ));
79- }
80-
81- public function testParamsControllerActionExplode ()
82- {
83- $ this ->markTestSkipped ("Check if is router test " );
84- $ routeObj = $ this ->object ->explode ("/walk/on/area/bar/status/inlove " );
85-
86- $ route = $ routeObj ->getRoute ();
87- $ params = $ routeObj ->getParams ();
88-
89- $ this ->assertEquals ("Walk " , $ route ["controller " ]);
90- $ this ->assertEquals ("on " , $ route ["action " ]);
91-
92- $ this ->assertInternalType ("array " , $ params );
93- $ this ->assertSame (2 , count ($ params ));
94-
95- $ keys = array_keys ($ params );
96- $ this ->assertEquals ("area " , $ keys [0 ]);
97- $ this ->assertEquals ("status " , $ keys [1 ]);
98-
99- $ this ->assertEquals ("bar " , $ params ["area " ]);
100- $ this ->assertEquals ("inlove " , $ params ["status " ]);
101- }
102-
103- public function testUnbalancedParamsExplode ()
104- {
105- $ this ->markTestSkipped ("Check if is router test " );
106- $ routeObj = $ this ->object ->explode ("/walk/on/area/bar/status " );
107-
108- $ route = $ routeObj ->getRoute ();
109- $ params = $ routeObj ->getParams ();
110-
111- $ this ->assertEquals ("Walk " , $ route ["controller " ]);
112- $ this ->assertEquals ("on " , $ route ["action " ]);
113-
114- $ this ->assertInternalType ("array " , $ params );
115- $ this ->assertSame (1 , count ($ params ));
116-
117- $ keys = array_keys ($ params );
118- $ this ->assertEquals ("area " , $ keys [0 ]);
119-
120- $ this ->assertEquals ("bar " , $ params ["area " ]);
121- }
122-
123- public function testComplexControllerName ()
124- {
125- $ this ->markTestSkipped ("Check if is router test " );
126- $ routeObj = $ this ->object ->explode ("/walk-on-files/hello-sunny-day/param/ok-this " );
127-
128- $ route = $ routeObj ->getRoute ();
129- $ params = $ routeObj ->getParams ();
130-
131- $ this ->assertEquals ("WalkOnFiles " , $ route ["controller " ]);
132- $ this ->assertEquals ("helloSunnyDay " , $ route ["action " ]);
133-
134- $ params = $ routeObj ->getParams ();
135- $ this ->assertEquals ("ok-this " , $ params ["param " ]);
136- }
137-
13832 /**
13933 * @expectedException RuntimeException
14034 */
@@ -146,7 +40,7 @@ public function testStrangeExplode()
14640
14741 public function testAddParam ()
14842 {
149- $ this ->markTestSkipped ("Check if is router test " );
43+ $ this ->markTestSkipped ("Check if is request test " );
15044 $ this ->object ->explode ("/index/index " );
15145 $ this ->object ->addParams (array ("hello " => "ciao " ));
15246 $ this ->object ->addParams (array ("bella " => 'zi ' ));
@@ -165,31 +59,4 @@ public function testClearGetParams()
16559 $ this ->assertEquals ("Index " , $ this ->object ->getControllerName ());
16660 $ this ->assertEquals ("index " , $ this ->object ->getActionName ());
16761 }
168-
169- public function testClearLongGetParams ()
170- {
171- $ this ->markTestSkipped ("Check if is router test " );
172- $ uri = '/?hello=world&titti=totti ' ;
173- $ this ->object ->explode ($ uri );
174- $ this ->assertEquals ("Index " , $ this ->object ->getControllerName ());
175- $ this ->assertEquals ("index " , $ this ->object ->getActionName ());
176- }
177-
178- public function testClearGet2Params ()
179- {
180- $ this ->markTestSkipped ("Check if is router test " );
181- $ uri = '/account?hello=world ' ;
182- $ this ->object ->explode ($ uri );
183- $ this ->assertEquals ("Index " , $ this ->object ->getControllerName ());
184- $ this ->assertEquals ("account " , $ this ->object ->getActionName ());
185- }
186-
187- public function testClearGet3Params ()
188- {
189- $ this ->markTestSkipped ("Check if is router test " );
190- $ uri = '/admin/account-super?hello=world ' ;
191- $ this ->object ->explode ($ uri );
192- $ this ->assertEquals ("Admin " , $ this ->object ->getControllerName ());
193- $ this ->assertEquals ("accountSuper " , $ this ->object ->getActionName ());
194- }
19562}
0 commit comments