From 894295bd747ae092dbbdf7a56f92d783faa82caa Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 13 Dec 2021 11:04:32 -0500 Subject: [PATCH] Adapt feature test to use HTTPS with example.com --- README.md | 6 ++-- features/db-search.feature | 61 +++++++++++++++++++------------------- src/DB_Command.php | 4 +-- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 69b36e8a..58df01ac 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,7 @@ for more details on the `OPTIMIZE TABLE` statement. Displays the database table prefix. ~~~ -wp db prefix +wp db prefix ~~~ Display the database table prefix, as defined by the database handler's interpretation of the current site. @@ -631,13 +631,13 @@ They can be concatenated. For instance, the default match color of black on a mu wp_options:option_value 1:http://wordpress-develop.dev wp_options:option_value - 1:http://example.com/foo + 1:https://example.com/foo ... # Search through a multisite database on the subsite 'foo' for the 'example.com' string $ wp db search example.com --url=example.com/foo wp_2_comments:comment_author_url - 1:http://example.com/ + 1:https://example.com/ wp_2_options:option_value ... diff --git a/features/db-search.feature b/features/db-search.feature index 7e674b0f..8e929d00 100644 --- a/features/db-search.feature +++ b/features/db-search.feature @@ -28,7 +28,7 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should not contain: """ @@ -44,7 +44,7 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should not contain: """ @@ -279,6 +279,7 @@ Feature: Search through the database """ And the return code should be 0 + @require-wp-4.0 Scenario: Search on a multisite install Given a WP multisite install And I run `wp site create --slug=foo` @@ -312,7 +313,7 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should not contain: """ @@ -336,7 +337,7 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should not contain: """ @@ -364,7 +365,7 @@ Feature: Search through the database And STDOUT should contain: """ wp_2_options:option_value - 1:http://example.com/foo + 1:https://example.com/foo """ And STDOUT should not contain: """ @@ -384,12 +385,12 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should contain: """ wp_2_options:option_value - 1:http://example.com/foo + 1:https://example.com/foo """ And STDOUT should not contain: """ @@ -409,7 +410,7 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should not contain: """ @@ -433,12 +434,12 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should contain: """ wp_2_options:option_value - 1:http://example.com/foo + 1:https://example.com/foo """ And STDOUT should contain: """ @@ -460,7 +461,7 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should not contain: """ @@ -488,7 +489,7 @@ Feature: Search through the database And STDOUT should contain: """ wp_2_options:option_value - 1:http://example.com/foo + 1:https://example.com/foo """ And STDOUT should not contain: """ @@ -509,12 +510,12 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should contain: """ wp_2_options:option_value - 1:http://example.com/foo + 1:https://example.com/foo """ And STDOUT should contain: """ @@ -537,12 +538,12 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should contain: """ wp_2_options:option_value - 1:http://example.com/foo + 1:https://example.com/foo """ And STDOUT should contain: """ @@ -712,7 +713,7 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ And STDOUT should not contain: """ @@ -868,31 +869,31 @@ Feature: Search through the database Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com wp_options:option_value - 2:http://example.com + 2:https://example.com """ When I run `wp db search example.com --table_column_once` Then STDOUT should contain: """ wp_options:option_value - 1:http://example.com - 2:http://example.com + 1:https://example.com + 2:https://example.com """ When I run `wp db search example.com --one_line` Then STDOUT should contain: """ - wp_options:option_value:1:http://example.com - wp_options:option_value:2:http://example.com + wp_options:option_value:1:https://example.com + wp_options:option_value:2:https://example.com """ When I run `wp db search example.com --table_column_once --one_line` Then STDOUT should contain: """ - wp_options:option_value:1:http://example.com - wp_options:option_value:2:http://example.com + wp_options:option_value:1:https://example.com + wp_options:option_value:2:https://example.com """ When I run `wp db search example.com --all-tables --before_context=0 --after_context=0 --matches_only` @@ -920,35 +921,35 @@ Feature: Search through the database Then STDOUT should strictly contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ When I run `SHELL_PIPE=0 wp db search example.com --table_column_color=%r --id_color=%g --match_color=%b` Then STDOUT should strictly contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ When I run `SHELL_PIPE=0 wp db search example.com --table_column_color=%r` Then STDOUT should strictly contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ When I run `SHELL_PIPE=0 wp db search example.com --id_color=%g` Then STDOUT should strictly contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ When I run `SHELL_PIPE=0 wp db search example.com --match_color=%b` Then STDOUT should strictly contain: """ wp_options:option_value - 1:http://example.com + 1:https://example.com """ When I run `SHELL_PIPE=0 wp db search example.com --before_context=0 --after_context=0` diff --git a/src/DB_Command.php b/src/DB_Command.php index 59644ca6..9be7a23d 100644 --- a/src/DB_Command.php +++ b/src/DB_Command.php @@ -1223,13 +1223,13 @@ public function prefix() { * wp_options:option_value * 1:http://wordpress-develop.dev * wp_options:option_value - * 1:http://example.com/foo + * 1:https://example.com/foo * ... * * # Search through a multisite database on the subsite 'foo' for the 'example.com' string * $ wp db search example.com --url=example.com/foo * wp_2_comments:comment_author_url - * 1:http://example.com/ + * 1:https://example.com/ * wp_2_options:option_value * ... *