Skip to content

Commit a932dc1

Browse files
committed
test: update test code
1 parent 7dbf0d1 commit a932dc1

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

tests/system/Router/AutoRouterImprovedTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testAutoRouteFindsDefaultControllerAndMethodGet()
5757
$router = $this->createNewAutoRouter();
5858

5959
[$directory, $controller, $method, $params]
60-
= $router->getRoute('/');
60+
= $router->getRoute('/', 'get');
6161

6262
$this->assertNull($directory);
6363
$this->assertSame('\\' . Index::class, $controller);
@@ -72,7 +72,7 @@ public function testAutoRouteFindsDefaultControllerAndMethodPost()
7272
$router = $this->createNewAutoRouter('post');
7373

7474
[$directory, $controller, $method, $params]
75-
= $router->getRoute('/');
75+
= $router->getRoute('/', 'post');
7676

7777
$this->assertNull($directory);
7878
$this->assertSame('\\' . Index::class, $controller);
@@ -85,7 +85,7 @@ public function testAutoRouteFindsControllerWithFileAndMethod()
8585
$router = $this->createNewAutoRouter();
8686

8787
[$directory, $controller, $method, $params]
88-
= $router->getRoute('mycontroller/somemethod');
88+
= $router->getRoute('mycontroller/somemethod', 'get');
8989

9090
$this->assertNull($directory);
9191
$this->assertSame('\\' . Mycontroller::class, $controller);
@@ -98,7 +98,7 @@ public function testFindsControllerAndMethodAndParam()
9898
$router = $this->createNewAutoRouter();
9999

100100
[$directory, $controller, $method, $params]
101-
= $router->getRoute('mycontroller/somemethod/a');
101+
= $router->getRoute('mycontroller/somemethod/a', 'get');
102102

103103
$this->assertNull($directory);
104104
$this->assertSame('\\' . Mycontroller::class, $controller);
@@ -115,15 +115,15 @@ public function testUriParamCountIsGreaterThanMethodParams()
115115

116116
$router = $this->createNewAutoRouter();
117117

118-
$router->getRoute('mycontroller/somemethod/a/b');
118+
$router->getRoute('mycontroller/somemethod/a/b', 'get');
119119
}
120120

121121
public function testAutoRouteFindsControllerWithFile()
122122
{
123123
$router = $this->createNewAutoRouter();
124124

125125
[$directory, $controller, $method, $params]
126-
= $router->getRoute('mycontroller');
126+
= $router->getRoute('mycontroller', 'get');
127127

128128
$this->assertNull($directory);
129129
$this->assertSame('\\' . Mycontroller::class, $controller);
@@ -136,7 +136,7 @@ public function testAutoRouteFindsControllerWithSubfolder()
136136
$router = $this->createNewAutoRouter();
137137

138138
[$directory, $controller, $method, $params]
139-
= $router->getRoute('subfolder/mycontroller/somemethod');
139+
= $router->getRoute('subfolder/mycontroller/somemethod', 'get');
140140

141141
$this->assertSame('Subfolder/', $directory);
142142
$this->assertSame('\\' . \CodeIgniter\Router\Controllers\Subfolder\Mycontroller::class, $controller);
@@ -149,7 +149,7 @@ public function testAutoRouteFindsDashedSubfolder()
149149
$router = $this->createNewAutoRouter();
150150

151151
[$directory, $controller, $method, $params]
152-
= $router->getRoute('dash-folder/mycontroller/somemethod');
152+
= $router->getRoute('dash-folder/mycontroller/somemethod', 'get');
153153

154154
$this->assertSame('Dash_folder/', $directory);
155155
$this->assertSame(
@@ -165,7 +165,7 @@ public function testAutoRouteFindsDashedController()
165165
$router = $this->createNewAutoRouter();
166166

167167
[$directory, $controller, $method, $params]
168-
= $router->getRoute('dash-folder/dash-controller/somemethod');
168+
= $router->getRoute('dash-folder/dash-controller/somemethod', 'get');
169169

170170
$this->assertSame('Dash_folder/', $directory);
171171
$this->assertSame('\\' . Dash_controller::class, $controller);
@@ -178,7 +178,7 @@ public function testAutoRouteFindsDashedMethod()
178178
$router = $this->createNewAutoRouter();
179179

180180
[$directory, $controller, $method, $params]
181-
= $router->getRoute('dash-folder/dash-controller/dash-method');
181+
= $router->getRoute('dash-folder/dash-controller/dash-method', 'get');
182182

183183
$this->assertSame('Dash_folder/', $directory);
184184
$this->assertSame('\\' . Dash_controller::class, $controller);
@@ -191,7 +191,7 @@ public function testAutoRouteFindsDefaultDashFolder()
191191
$router = $this->createNewAutoRouter();
192192

193193
[$directory, $controller, $method, $params]
194-
= $router->getRoute('dash-folder');
194+
= $router->getRoute('dash-folder', 'get');
195195

196196
$this->assertSame('Dash_folder/', $directory);
197197
$this->assertSame('\\' . Home::class, $controller);
@@ -205,7 +205,7 @@ public function testAutoRouteRejectsSingleDot()
205205

206206
$router = $this->createNewAutoRouter();
207207

208-
$router->getRoute('.');
208+
$router->getRoute('.', 'get');
209209
}
210210

211211
public function testAutoRouteRejectsDoubleDot()
@@ -214,7 +214,7 @@ public function testAutoRouteRejectsDoubleDot()
214214

215215
$router = $this->createNewAutoRouter();
216216

217-
$router->getRoute('..');
217+
$router->getRoute('..', 'get');
218218
}
219219

220220
public function testAutoRouteRejectsMidDot()
@@ -223,7 +223,7 @@ public function testAutoRouteRejectsMidDot()
223223

224224
$router = $this->createNewAutoRouter();
225225

226-
$router->getRoute('foo.bar');
226+
$router->getRoute('foo.bar', 'get');
227227
}
228228

229229
public function testRejectsDefaultControllerPath()
@@ -232,7 +232,7 @@ public function testRejectsDefaultControllerPath()
232232

233233
$router = $this->createNewAutoRouter();
234234

235-
$router->getRoute('home');
235+
$router->getRoute('home', 'get');
236236
}
237237

238238
public function testRejectsDefaultControllerAndDefaultMethodPath()
@@ -241,7 +241,7 @@ public function testRejectsDefaultControllerAndDefaultMethodPath()
241241

242242
$router = $this->createNewAutoRouter();
243243

244-
$router->getRoute('home/index');
244+
$router->getRoute('home/index', 'get');
245245
}
246246

247247
public function testRejectsDefaultMethodPath()
@@ -250,7 +250,7 @@ public function testRejectsDefaultMethodPath()
250250

251251
$router = $this->createNewAutoRouter();
252252

253-
$router->getRoute('mycontroller/index');
253+
$router->getRoute('mycontroller/index', 'get');
254254
}
255255

256256
public function testRejectsControllerWithRemapMethod()
@@ -262,6 +262,6 @@ public function testRejectsControllerWithRemapMethod()
262262

263263
$router = $this->createNewAutoRouter();
264264

265-
$router->getRoute('remap/test');
265+
$router->getRoute('remap/test', 'get');
266266
}
267267
}

0 commit comments

Comments
 (0)