Skip to content

Commit 89b8328

Browse files
authored
Merge pull request #31 from wp-cli/plugin-tests
Make it easier to write tests for WordPress plugins containing CLI commands
2 parents 7fcebcc + 36b47c9 commit 89b8328

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ private static function get_behat_internal_variables() {
209209
}
210210

211211
$variables = [
212-
'SRC_DIR' => realpath( dirname( dirname( __DIR__ ) ) ),
213212
'FRAMEWORK_ROOT' => realpath( $framework_root ),
213+
'SRC_DIR' => realpath( dirname( dirname( __DIR__ ) ) ),
214+
'PROJECT_DIR' => realpath( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ),
214215
];
215216

216217
return $variables;

features/steps/given.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ function ( $world, $type = 'subdirectory' ) {
134134
'/^these installed and active plugins:$/',
135135
function( $world, $stream ) {
136136
$plugins = implode( ' ', array_map( 'trim', explode( PHP_EOL, (string) $stream ) ) );
137+
$plugins = $world->replace_variables( $plugins );
138+
137139
$world->proc( "wp plugin install $plugins --activate" )->run_check();
138140
}
139141
);

0 commit comments

Comments
 (0)