From 7b1c59ba0d72f278f6b1badd13c0a22a4129110a Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Wed, 3 Apr 2024 09:40:11 -0600 Subject: [PATCH] use world_proc since wp isn't actually installed at behat runtime --- features/steps/given.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/features/steps/given.php b/features/steps/given.php index f9d78d5..3af9987 100644 --- a/features/steps/given.php +++ b/features/steps/given.php @@ -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);