OSDN Git Service

fix WP_CLI::error() not exiting
authorscribu <mail@scribu.net>
Fri, 8 Feb 2013 02:14:44 +0000 (04:14 +0200)
committerscribu <mail@scribu.net>
Fri, 8 Feb 2013 02:14:44 +0000 (04:14 +0200)
php/class-wp-cli.php
tests/spec-core.php

index 02f65c2..ad70c61 100644 (file)
@@ -136,8 +136,7 @@ class WP_CLI {
                        fwrite( STDERR, \cli\Colors::colorize( $msg, self::get_config('color') ) );
                }
 
-               if ( $exit )
-                       exit(1);
+               exit(1);
        }
 
        /**
index 90a83bd..d7dab9e 100644 (file)
@@ -40,6 +40,7 @@ class CoreCommandSpec extends WP_CLI_Spec {
                        ->when( 'invoking', '' )
                        ->then( 'return code should be', 1 )
                        ->and( 'stderr', "Error: Can’t select database\n" )
+                       ->and( 'stdout', '' )
 
                        ->when( 'invoking', 'db create' )
                        ->then( 'return code should be', 0 );