Skip to content
Permalink
Browse files

Test case to prove issue with DashedRoute

  • Loading branch information...
dakota committed Dec 9, 2015
1 parent 9cbd921 commit 50967f6ab2d8a3c3c75149d9788804f6eb42d9ad
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/TestCase/Routing/Route/DashedRouteTest.php
@@ -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.
You can’t perform that action at this time.