From f1762dddebe7d27bd8e2609903569af55ea913d6 Mon Sep 17 00:00:00 2001 From: scribu Date: Tue, 12 Mar 2013 15:19:53 +0200 Subject: [PATCH] run core install-network when WP_MULTISITE=1 --- features/bootstrap/FeatureContext.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 8fb9912b..91dd59fb 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -180,14 +180,24 @@ class FeatureContext extends BehatContext implements ClosuredContextInterface } public function run_install() { - $cmd = 'core install' . \WP_CLI\Utils\assoc_args_to_str( array( + $install_r = $this->run( 'core install' . \WP_CLI\Utils\assoc_args_to_str( array( 'url' => 'http://example.com', - 'title' => 'WP CLI Tests', + 'title' => 'WP CLI Site', 'admin_email' => 'admin@example.com', 'admin_password' => 'password1' - ) ); + ) ) ); + + if ( 0 !== $install_r->return_code ) { + return $install_r; + } + + if ( getenv( 'WP_MULTISITE' ) === '1' ) { + $install_r = $this->run( 'core install-network' . \WP_CLI\Utils\assoc_args_to_str( array( + 'title' => 'WP CLI Network' + ) ) ); + } - return $this->run( $cmd ); + return $install_r; } public function download_wordpress_files() { -- 2.11.0