Skip to content

Commit

Permalink
Merge pull request #13 from wp-cli/update-test-scaffold
Browse files Browse the repository at this point in the history
Update scaffolded tests to latest
  • Loading branch information
schlessera committed Sep 29, 2017
2 parents f1666a2 + 5613ce6 commit 1cf9cb3
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 73 deletions.
8 changes: 6 additions & 2 deletions features/bootstrap/FeatureContext.php
Expand Up @@ -699,11 +699,15 @@ public function get_php_binary() {
return 'php';
}

public function start_php_server() {
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(),
'localhost:8080',
$this->variables['RUN_DIR'] . '/wordpress/',
$dir,
get_cfg_var( 'cfg_file_path' ),
$this->variables['RUN_DIR'] . '/vendor/wp-cli/server-command/router.php'
);
Expand Down
22 changes: 12 additions & 10 deletions features/bootstrap/Process.php
Expand Up @@ -87,15 +87,17 @@ public function run() {
self::$run_times[ $this->command ][1]++;
}

return new ProcessRun( array(
'stdout' => $stdout,
'stderr' => $stderr,
'return_code' => $return_code,
'command' => $this->command,
'cwd' => $this->cwd,
'env' => $this->env,
'run_time' => $run_time,
) );
return new ProcessRun(
array(
'stdout' => $stdout,
'stderr' => $stderr,
'return_code' => $return_code,
'command' => $this->command,
'cwd' => $this->cwd,
'env' => $this->env,
'run_time' => $run_time,
)
);
}

/**
Expand All @@ -107,7 +109,7 @@ public function run_check() {
$r = $this->run();

// $r->STDERR is incorrect, but kept incorrect for backwards-compat
if ( $r->return_code || !empty( $r->STDERR ) ) {
if ( $r->return_code || ! empty( $r->STDERR ) ) {
throw new \RuntimeException( $r );
}

Expand Down

0 comments on commit 1cf9cb3

Please sign in to comment.