OSDN Git Service

fix `wp core is-installed` expectations for singlesite
authorscribu <mail@scribu.net>
Sun, 5 Jan 2014 06:19:32 +0000 (08:19 +0200)
committerscribu <mail@scribu.net>
Sun, 5 Jan 2014 06:19:55 +0000 (08:19 +0200)
features/core.feature
php/WP_CLI/Runner.php

index 5f41b24..bf9fd8d 100644 (file)
@@ -84,11 +84,6 @@ Feature: Manage WordPress installation
 
     When I try `wp core is-installed`
     Then the return code should be 1
-    And STDERR should be:
-      """
-      Error: The site you have requested is not installed.
-      Run `wp core install`.
-      """
 
     When I try `wp core install`
     Then the return code should be 1
index 9033d4c..15729dc 100644 (file)
@@ -463,10 +463,14 @@ class Runner {
                        exit;
                }
 
+               if ( $this->cmd_starts_with( array( 'core', 'is-installed' ) ) ) {
+                       define( 'WP_INSTALLING', true );
+               }
+
                if (
                        count( $this->arguments ) >= 2 &&
                        $this->arguments[0] == 'core' &&
-                       in_array( $this->arguments[1], array( 'install', 'multisite-install', 'is-installed' ) )
+                       in_array( $this->arguments[1], array( 'install', 'multisite-install' ) )
                ) {
                        define( 'WP_INSTALLING', true );