Browse Source

Update tests to match code

Andy Dawson 7 years ago
parent
commit
ce1e801726
2 changed files with 6 additions and 5 deletions
  1. 1 0
      src/Shell/RoutesShell.php
  2. 5 5
      tests/TestCase/Shell/RoutesShellTest.php

+ 1 - 0
src/Shell/RoutesShell.php

@@ -65,6 +65,7 @@ class RoutesShell extends Shell
             }
 
             unset($route['_matchedRoute']);
+            ksort($route);
 
             $output = [
                 ['Route name', 'URI template', 'Defaults'],

+ 5 - 5
tests/TestCase/Shell/RoutesShellTest.php

@@ -65,17 +65,17 @@ class RoutesShellTest extends ConsoleIntegrationTestCase
         $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 @@ class RoutesShellTest extends ConsoleIntegrationTestCase
         $this->assertOutputContainsRow([
             'articles:_action',
             '/articles/check',
-            '{"action":"check","pass":[],"controller":"Articles","plugin":null}'
+            '{"action":"check","controller":"Articles","pass":[],"plugin":null}'
         ]);
     }
 
@@ -117,7 +117,7 @@ class RoutesShellTest extends ConsoleIntegrationTestCase
         $this->assertOutputContainsRow([
             'testName',
             '/tests/index',
-            '{"action":"index","pass":[],"controller":"Tests","plugin":null,"_name":"testName"}'
+            '{"_name":"testName","action":"index","controller":"Tests","pass":[],"plugin":null}'
         ]);
     }