Skip to content

Commit

Permalink
Merge c9e4aa1 into 946e7db
Browse files Browse the repository at this point in the history
  • Loading branch information
beporter committed Sep 21, 2018
2 parents 946e7db + c9e4aa1 commit 2d62560
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Routing/Route/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ protected function _matchMethod($url)
$url['_method'] = $url['[method]'];
}
if (empty($url['_method'])) {
return false;
$url['_method'] = 'GET';
}
$methods = array_map('strtoupper', (array)$url['_method']);
foreach ($methods as $value) {
Expand Down
18 changes: 18 additions & 0 deletions tests/TestCase/Routing/Route/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,24 @@ public function testMatchWithMultibytePattern()
$this->assertEquals("/articles/view/\xC4\x81", $result);
}

/**
* Test that match() matches explicit GET routes
*
* @return void
*/
public function testMatchWithExplicitGet()
{
$route = new Route(
'/anything',
['controller' => 'Articles', 'action' => 'foo', '_method' => 'GET']
);
$result = $route->match([
'controller' => 'Articles',
'action' => 'foo'
]);
$this->assertEquals("/anything", $result);
}

/**
* Test separartor.
*
Expand Down

0 comments on commit 2d62560

Please sign in to comment.