Skip to content

Commit

Permalink
Merge pull request #31 from wp-cli/plugin-tests
Browse files Browse the repository at this point in the history
Make it easier to write tests for WordPress plugins containing CLI commands
  • Loading branch information
schlessera authored Dec 3, 2018
2 parents 7fcebcc + 36b47c9 commit 89b8328
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ private static function get_behat_internal_variables() {
}

$variables = [
'SRC_DIR' => realpath( dirname( dirname( __DIR__ ) ) ),
'FRAMEWORK_ROOT' => realpath( $framework_root ),
'SRC_DIR' => realpath( dirname( dirname( __DIR__ ) ) ),
'PROJECT_DIR' => realpath( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ),
];

return $variables;
Expand Down
2 changes: 2 additions & 0 deletions features/steps/given.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ function ( $world, $type = 'subdirectory' ) {
'/^these installed and active plugins:$/',
function( $world, $stream ) {
$plugins = implode( ' ', array_map( 'trim', explode( PHP_EOL, (string) $stream ) ) );
$plugins = $world->replace_variables( $plugins );

$world->proc( "wp plugin install $plugins --activate" )->run_check();
}
);
Expand Down

0 comments on commit 89b8328

Please sign in to comment.