Skip to content

Commit 736866a

Browse files
authored
Merge pull request #7574 from kenjis/fix-AutoRouterImproved-4.4
fix: [4.4] AutoRouterImproved merge conflicts
2 parents eac3eda + 54f2f65 commit 736866a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

system/Router/AutoRouterImproved.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ public function getRoute(string $uri, string $httpVerb): array
254254
'Cannot access the default method "' . $this->method . '" with the method name URI path.'
255255
);
256256
}
257-
} elseif (method_exists($this->controller, $this->defaultMethod)) {
257+
} elseif (method_exists($this->controller, $defaultMethod)) {
258258
// The default method is found.
259-
$this->method = $this->defaultMethod;
259+
$this->method = $defaultMethod;
260260
} else {
261261
// No method is found.
262262
throw PageNotFoundException::forControllerNotFound($this->controller, $method);

tests/system/Router/AutoRouterImprovedTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testAutoRouteFindsModuleDefaultControllerAndMethodGet()
8080
$router = $this->createNewAutoRouter('get', 'App/Controllers');
8181

8282
[$directory, $controller, $method, $params]
83-
= $router->getRoute('test');
83+
= $router->getRoute('test', 'get');
8484

8585
$this->assertNull($directory);
8686
$this->assertSame('\\' . Index::class, $controller);
@@ -172,7 +172,7 @@ public function testAutoRouteFindsControllerWithSubSubfolder()
172172
$router = $this->createNewAutoRouter();
173173

174174
[$directory, $controller, $method, $params]
175-
= $router->getRoute('subfolder/sub/mycontroller/somemethod');
175+
= $router->getRoute('subfolder/sub/mycontroller/somemethod', 'get');
176176

177177
$this->assertSame('Subfolder/Sub/', $directory);
178178
$this->assertSame('\\' . \CodeIgniter\Router\Controllers\Subfolder\Sub\Mycontroller::class, $controller);
@@ -240,7 +240,7 @@ public function testAutoRouteFallbackToDefaultMethod()
240240
$router = $this->createNewAutoRouter();
241241

242242
[$directory, $controller, $method, $params]
243-
= $router->getRoute('index/15');
243+
= $router->getRoute('index/15', 'get');
244244

245245
$this->assertNull($directory);
246246
$this->assertSame('\\' . Index::class, $controller);
@@ -253,7 +253,7 @@ public function testAutoRouteFallbackToDefaultControllerOneParam()
253253
$router = $this->createNewAutoRouter();
254254

255255
[$directory, $controller, $method, $params]
256-
= $router->getRoute('subfolder/15');
256+
= $router->getRoute('subfolder/15', 'get');
257257

258258
$this->assertSame('Subfolder/', $directory);
259259
$this->assertSame('\\' . \CodeIgniter\Router\Controllers\Subfolder\Home::class, $controller);
@@ -266,7 +266,7 @@ public function testAutoRouteFallbackToDefaultControllerTwoParams()
266266
$router = $this->createNewAutoRouter();
267267

268268
[$directory, $controller, $method, $params]
269-
= $router->getRoute('subfolder/15/20');
269+
= $router->getRoute('subfolder/15/20', 'get');
270270

271271
$this->assertSame('Subfolder/', $directory);
272272
$this->assertSame('\\' . \CodeIgniter\Router\Controllers\Subfolder\Home::class, $controller);
@@ -279,7 +279,7 @@ public function testAutoRouteFallbackToDefaultControllerNoParams()
279279
$router = $this->createNewAutoRouter();
280280

281281
[$directory, $controller, $method, $params]
282-
= $router->getRoute('subfolder');
282+
= $router->getRoute('subfolder', 'get');
283283

284284
$this->assertSame('Subfolder/', $directory);
285285
$this->assertSame('\\' . \CodeIgniter\Router\Controllers\Subfolder\Home::class, $controller);

0 commit comments

Comments
 (0)