-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from wp-cli/update_tests_enable_error_reporting
Update scaffolded tests to latest (enable error reporting).
- Loading branch information
Showing
9 changed files
with
207 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,12 @@ private static function get_process_env_variables() { | |
if ( $php_args = getenv( 'WP_CLI_PHP_ARGS' ) ) { | ||
$env['WP_CLI_PHP_ARGS'] = $php_args; | ||
} | ||
if ( $php_used = getenv( 'WP_CLI_PHP_USED' ) ) { | ||
$env['WP_CLI_PHP_USED'] = $php_used; | ||
} | ||
if ( $php = getenv( 'WP_CLI_PHP' ) ) { | ||
$env['WP_CLI_PHP'] = $php; | ||
} | ||
if ( $travis_build_dir = getenv( 'TRAVIS_BUILD_DIR' ) ) { | ||
$env['TRAVIS_BUILD_DIR'] = $travis_build_dir; | ||
} | ||
|
@@ -526,7 +532,8 @@ public function background_proc( $cmd ) { | |
$status = proc_get_status( $proc ); | ||
|
||
if ( !$status['running'] ) { | ||
throw new RuntimeException( stream_get_contents( $pipes[2] ) ); | ||
$stderr = is_resource( $pipes[2] ) ? ( ': ' . stream_get_contents( $pipes[2] ) ) : ''; | ||
throw new RuntimeException( sprintf( "Failed to start background process '%s'%s.", $cmd, $stderr ) ); | ||
} else { | ||
$this->running_procs[] = $proc; | ||
} | ||
|
@@ -617,7 +624,8 @@ public function install_wp( $subdir = '' ) { | |
'title' => 'WP CLI Site', | ||
'admin_user' => 'admin', | ||
'admin_email' => '[email protected]', | ||
'admin_password' => 'password1' | ||
'admin_password' => 'password1', | ||
'skip-email' => true, | ||
); | ||
|
||
$install_cache_path = ''; | ||
|
@@ -658,7 +666,8 @@ public function install_wp_with_composer( $vendor_directory = 'vendor' ) { | |
'title' => 'WP CLI Site with both WordPress and wp-cli as Composer dependencies', | ||
'admin_user' => 'admin', | ||
'admin_email' => '[email protected]', | ||
'admin_password' => 'password1' | ||
'admin_password' => 'password1', | ||
'skip-email' => true, | ||
); | ||
|
||
$this->proc( 'wp core install', $install_args )->run_check(); | ||
|
@@ -686,26 +695,13 @@ public function composer_require_current_wp_cli() { | |
$this->composer_command( 'require wp-cli/wp-cli:dev-master --optimize-autoloader --no-interaction' ); | ||
} | ||
|
||
public function get_php_binary() { | ||
if ( getenv( 'WP_CLI_PHP_USED' ) ) | ||
return getenv( 'WP_CLI_PHP_USED' ); | ||
|
||
if ( getenv( 'WP_CLI_PHP' ) ) | ||
return getenv( 'WP_CLI_PHP' ); | ||
|
||
if ( defined( 'PHP_BINARY' ) ) | ||
return PHP_BINARY; | ||
|
||
return 'php'; | ||
} | ||
|
||
public function start_php_server( $subdir = '' ) { | ||
$dir = $this->variables['RUN_DIR'] . '/'; | ||
if ( $subdir ) { | ||
$dir .= trim( $subdir, '/' ) . '/'; | ||
} | ||
$cmd = Utils\esc_cmd( '%s -S %s -t %s -c %s %s', | ||
$this->get_php_binary(), | ||
Utils\get_php_binary(), | ||
'localhost:8080', | ||
$dir, | ||
get_cfg_var( 'cfg_file_path' ), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.