Browse Source

Merge branch 'master' into 4.next

Mark Story 6 years ago
parent
commit
6fc2a534ef

+ 4 - 1
config/bootstrap.php

@@ -15,7 +15,10 @@
 
 use Cake\Routing\Router;
 
-define('TIME_START', microtime(true));
+/**
+ * @var float
+ */
+define('TIME_START', (float)microtime(true));
 
 require CAKE . 'basics.php';
 

+ 1 - 0
src/Command/RoutesCheckCommand.php

@@ -90,6 +90,7 @@ class RoutesCheckCommand extends Command
         )
         ->addArgument('url', [
             'help' => 'The URL to check.',
+            'required' => true,
         ]);
 
         return $parser;

+ 2 - 2
src/Database/Driver/Sqlserver.php

@@ -239,7 +239,7 @@ class Sqlserver extends Driver
      */
     public function disableForeignKeySQL(): string
     {
-        return 'EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"';
+        return 'EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"';
     }
 
     /**
@@ -247,7 +247,7 @@ class Sqlserver extends Driver
      */
     public function enableForeignKeySQL(): string
     {
-        return 'EXEC sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"';
+        return 'EXEC sp_MSforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"';
     }
 
     /**

+ 12 - 0
tests/TestCase/Command/RoutesCommandTest.php

@@ -109,6 +109,18 @@ class RoutesCommandTest extends TestCase
     }
 
     /**
+     * Ensure routes check with no input
+     *
+     * @return void
+     */
+    public function testCheckNoInput()
+    {
+        $this->exec('routes check');
+        $this->assertExitCode(Command::CODE_ERROR);
+        $this->assertErrorContains('`url` argument is required');
+    }
+
+    /**
      * Test checking an existing route.
      *
      * @return void