diff --git a/src/Shell/RoutesShell.php b/src/Shell/RoutesShell.php index 0ef6f173dae..00eb608fc3a 100644 --- a/src/Shell/RoutesShell.php +++ b/src/Shell/RoutesShell.php @@ -65,6 +65,7 @@ public function check($url) } unset($route['_matchedRoute']); + ksort($route); $output = [ ['Route name', 'URI template', 'Defaults'], diff --git a/tests/TestCase/Shell/RoutesShellTest.php b/tests/TestCase/Shell/RoutesShellTest.php index a20460ff252..9923286d709 100644 --- a/tests/TestCase/Shell/RoutesShellTest.php +++ b/tests/TestCase/Shell/RoutesShellTest.php @@ -65,17 +65,17 @@ public function testMain() $this->assertOutputContainsRow([ 'articles:_action', '/articles/:action/*', - '{"controller":"Articles","action":"index","plugin":null}' + '{"action":"index","controller":"Articles","plugin":null}' ]); $this->assertOutputContainsRow([ 'bake._controller:_action', '/bake/:controller/:action', - '{"plugin":"Bake","action":"index"}' + '{"action":"index","plugin":"Bake"}' ]); $this->assertOutputContainsRow([ 'testName', '/tests/:action/*', - '{"controller":"Tests","action":"index","plugin":null}' + '{"action":"index","controller":"Tests","plugin":null}' ]); } @@ -96,7 +96,7 @@ public function testCheck() $this->assertOutputContainsRow([ 'articles:_action', '/articles/check', - '{"action":"check","pass":[],"controller":"Articles","plugin":null}' + '{"action":"check","controller":"Articles","pass":[],"plugin":null}' ]); } @@ -117,7 +117,7 @@ public function testCheckWithNamedRoute() $this->assertOutputContainsRow([ 'testName', '/tests/index', - '{"action":"index","pass":[],"controller":"Tests","plugin":null,"_name":"testName"}' + '{"_name":"testName","action":"index","controller":"Tests","pass":[],"plugin":null}' ]); }