From 6ff1d6b0bac5507754da0be05f13704d8d8b6068 Mon Sep 17 00:00:00 2001 From: Mark Berube <10816162+MarkBerube@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:54:23 -0600 Subject: [PATCH] adding safe object to search & replace over in test --- features/search-replace.feature | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/features/search-replace.feature b/features/search-replace.feature index 028411a0..fd8e574a 100644 --- a/features/search-replace.feature +++ b/features/search-replace.feature @@ -1110,21 +1110,22 @@ Feature: Do global search/replace Given a WP install And I run `wp db query "INSERT INTO wp_options (option_name,option_value) VALUES ('cereal_isation','O:13:\"mysqli_result\":5:{s:13:\"current_field\";N;s:11:\"field_count\";N;s:7:\"lengths\";N;s:8:\"num_rows\";N;s:4:\"type\";N;}')"` + And I run `wp db query "INSERT INTO wp_options (option_name,option_value) VALUES ('cereal_isation_2','O:8:\"mysqli_result\":5:{s:13:\"current_field\";i:1;s:11:\"field_count\";i:2;s:7:\"lengths\";a:1:{i:0;s:4:\"blah\";}s:8:\"num_rows\";i:1;s:4:\"type\";i:2;}')"` - When I try `wp search-replace current_field current_field1` + When I try `wp search-replace mysqli_result stdClass` Then STDERR should contain: """ Warning: Skipping an inconvertible serialized object: "O:13:"mysqli_result":5:{s:13:"current_field";N;s:11:"field_count";N;s:7:"lengths";N;s:8:"num_rows";N;s:4:"type";N;}", replacements might not be complete. """ And STDOUT should contain: """ - Success: Made 0 replacements. + Success: Made 1 replacement. """ - When I run `wp db query "SELECT option_value from wp_options where option_name='cereal_isation'"` + When I run `wp db query "SELECT option_value from wp_options where option_name='cereal_isation_2'"` Then STDOUT should contain: """ - O:13:"mysqli_result":5:{s:13:"current_field";N;s:11:"field_count";N;s:7:"lengths";N;s:8:"num_rows";N;s:4:"type";N;} + O:8:"stdClass":5:{s:13:"current_field";i:1;s:11:"field_count";i:2;s:7:"lengths";a:1:{i:0;s:4:"blah";}s:8:"num_rows";i:1;s:4:"type";i:2;} """ Scenario: Regex search/replace with `--regex-limit=1` option