Skip to content

Commit

Permalink
Test case to prove issue with DashedRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
dakota committed Dec 9, 2015
1 parent 9cbd921 commit 50967f6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/TestCase/Routing/Route/DashedRouteTest.php
Expand Up @@ -192,4 +192,25 @@ public function testParse()
$this->assertEquals('searchIt', $result['action']);
$this->assertEquals(['tv_shows'], $result['pass']);
}

/**
* @return void
*/
public function testMatchThenParse()
{
$route = new DashedRoute('/plugin/:controller/:action', [
'plugin' => 'Vendor/PluginName'
]);
$url = $route->match([
'plugin' => 'Vendor/PluginName',
'controller' => 'ControllerName',
'action' => 'actionName'
]);
$expected_url = '/plugin/controller-name/action-name';
$this->assertEquals($expected_url, $url);
$result = $route->parse($expected_url);
$this->assertEquals('ControllerName', $result['controller']);
$this->assertEquals('actionName', $result['action']);
$this->assertEquals('Vendor/PluginName', $result['plugin']);
}
}

0 comments on commit 50967f6

Please sign in to comment.