From a729a52968e5be2a0a4cd22b2a7fd7b22add6651 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Fri, 30 Oct 2026 19:48:45 +0100 Subject: [PATCH] Test wp-cli/wp-cli-tests#398 Co-Authored-By: Claude Opus 5.5 --- composer.json | 2 +- features/option-list.feature | 34 +++++++++++++++++++++------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index fcd353184..2e150ed0f 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "wp-cli/extension-command": "^1.2 || ^2 || ^3", "wp-cli/media-command": "^1.1 || ^2 || ^3", "wp-cli/super-admin-command": "^1 || ^2 || ^3", - "wp-cli/wp-cli-tests": "^5" + "wp-cli/wp-cli-tests": "dev-set-options-step as 5.3.99" }, "config": { "process-timeout": 7200, diff --git a/features/option-list.feature b/features/option-list.feature index 38bd86925..c4629554c 100644 --- a/features/option-list.feature +++ b/features/option-list.feature @@ -61,10 +61,12 @@ Feature: List WordPress options Scenario: List option with exclude pattern Given a WP install + And these options: + | name | value | + | sample_test_field_one | sample_test_field_value_one | + | sample_test_field_two | sample_test_field_value_two | - When I run `wp option add sample_test_field_one sample_test_field_value_one` - And I run `wp option add sample_test_field_two sample_test_field_value_two` - And I run `wp option list --search="sample_test_field_*" --format=csv` + When I run `wp option list --search="sample_test_field_*" --format=csv` Then STDOUT should be: """ option_name,option_value @@ -93,8 +95,10 @@ Feature: List WordPress options Scenario: List option with sorting option Given a WP install - And I run `wp option add sample_test_field_one sample_test_field_value_one` - And I run `wp option add sample_test_field_two sample_test_field_value_two` + And these options: + | name | value | + | sample_test_field_one | sample_test_field_value_one | + | sample_test_field_two | sample_test_field_value_two | When I run `wp option list --search="sample_test_field_*" --format=csv --orderby=option_id --order=asc` Then STDOUT should be: @@ -178,10 +182,12 @@ Feature: List WordPress options Scenario: Using the `--autoload=on` flag Given a WP install - And I run `wp option add sample_autoload_one 'sample_value_one' --autoload=yes` - And I run `wp option add sample_autoload_two 'sample_value_two' --autoload=no` - And I run `wp option add sample_autoload_three 'sample_value_three' --autoload=on` - And I run `wp option add sample_autoload_four 'sample_value_four' --autoload=off` + And these options: + | name | value | autoload | + | sample_autoload_one | sample_value_one | yes | + | sample_autoload_two | sample_value_two | no | + | sample_autoload_three | sample_value_three | on | + | sample_autoload_four | sample_value_four | off | When I run `wp option list --autoload=on` Then STDOUT should not contain: @@ -203,10 +209,12 @@ Feature: List WordPress options Scenario: Using the `--autoload=off` flag Given a WP install - And I run `wp option add sample_autoload_one 'sample_value_one' --autoload=yes` - And I run `wp option add sample_autoload_two 'sample_value_two' --autoload=no` - And I run `wp option add sample_autoload_three 'sample_value_three' --autoload=on` - And I run `wp option add sample_autoload_four 'sample_value_four' --autoload=off` + And these options: + | name | value | autoload | + | sample_autoload_one | sample_value_one | yes | + | sample_autoload_two | sample_value_two | no | + | sample_autoload_three | sample_value_three | on | + | sample_autoload_four | sample_value_four | off | When I run `wp option list --autoload=off` Then STDOUT should not contain: