Skip to content

Commit

Permalink
parsed url now contains '_name' property
Browse files Browse the repository at this point in the history
and fix duplicated test
  • Loading branch information
saeideng committed Jan 15, 2018
1 parent 8a9e82b commit da501ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions tests/TestCase/Routing/RouteCollectionTest.php
Expand Up @@ -361,7 +361,7 @@ public function testParseRequest()
$routes = new RouteBuilder($this->collection, '/b', ['key' => 'value']);
$routes->connect('/', ['controller' => 'Articles']);
$routes->connect('/:id', ['controller' => 'Articles', 'action' => 'view']);
$routes->connect('/media/search/*', ['controller' => 'Media', 'action' => 'search'], ['_name' => 'media_search']);
$routes->connect('/media/search/*', ['controller' => 'Media', 'action' => 'search']);

$request = new ServerRequest(['url' => '/b/']);
$result = $this->collection->parseRequest($request);
Expand All @@ -384,7 +384,6 @@ public function testParseRequest()
'controller' => 'Media',
'action' => 'search',
'_matchedRoute' => '/b/media/search/*',
'_name' => 'media_search'
];
$this->assertEquals($expected, $result);

Expand All @@ -397,7 +396,6 @@ public function testParseRequest()
'controller' => 'Media',
'action' => 'search',
'_matchedRoute' => '/b/media/search/*',
'_name' => 'media_search'
];
$this->assertEquals($expected, $result);

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Shell/RoutesShellTest.php
Expand Up @@ -117,7 +117,7 @@ public function testCheckWithNamedRoute()
$this->assertOutputContainsRow([
'testName',
'/tests/index',
'{"action":"index","pass":[],"controller":"Tests","plugin":null}'
'{"action":"index","pass":[],"controller":"Tests","plugin":null,"_name":"testName"}'
]);
}

Expand Down

0 comments on commit da501ee

Please sign in to comment.