Skip to content

Commit

Permalink
use world_proc since wp isn't actually installed at behat runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Apr 3, 2024
1 parent b09f585 commit 7b1c59b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions features/steps/given.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,14 @@ function($world) {

$steps->Given('/^the current WP version is not the latest$/', function ($world) {
// Use wp-cli to get the currently installed WordPress version.
$currentVersion = shell_exec('wp core version');
$currentVersion = $world->proc('wp core version', [])
->run_check()
->stdout();

// Use wp-cli to get the latest WordPress version available.
$latestVersion = shell_exec('wp core check-update --field=version');
$latestVersion = $world->proc('wp core check-update --field=version', [])
->run_check()
->stdout();

// Normalize versions (remove new lines).
$currentVersion = trim($currentVersion);
Expand Down

0 comments on commit 7b1c59b

Please sign in to comment.