OSDN Git Service

run the functional tests against the Phar file
authorscribu <mail@scribu.net>
Wed, 14 Aug 2013 20:20:29 +0000 (23:20 +0300)
committerscribu <mail@scribu.net>
Wed, 14 Aug 2013 20:40:40 +0000 (23:40 +0300)
bin/ci/run_build.sh
features/bootstrap/Process.php

index 2fb25df..f3cd75e 100755 (executable)
@@ -4,4 +4,13 @@ set -ex
 
 phpunit
 
-php behat.phar --format progress
+# Run the functional tests against the Phar file
+
+WP_CLI_BIN_DIR=/tmp/wp-cli-phar
+
+mkdir -p $WP_CLI_BIN_DIR
+php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --quiet
+mv wp-cli.phar $WP_CLI_BIN_DIR/wp
+chmod +x $WP_CLI_BIN_DIR/wp
+
+WP_CLI_BIN_DIR=$WP_CLI_BIN_DIR php behat.phar --format progress
index 992428a..072b6b1 100644 (file)
@@ -28,8 +28,10 @@ class Process {
                );
 
                // Ensure we're using the expected `wp` binary
+               $bin_dir = getenv( 'WP_CLI_BIN_DIR' ) ?: realpath( __DIR__ . "/../../bin" );
+
                $proc = proc_open( $this->command, $descriptors, $pipes, $cwd, array(
-                       'PATH' => realpath( __DIR__ . "/../../bin" ) . ':' . getenv( 'PATH' ),
+                       'PATH' =>  $bin_dir . ':' . getenv( 'PATH' ),
                        'BEHAT_RUN' => 1
                ) );