Skip to content

Commit 6ff1d6b

Browse files
committed
adding safe object to search & replace over in test
1 parent 57cb6eb commit 6ff1d6b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

features/search-replace.feature

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,21 +1110,22 @@ Feature: Do global search/replace
11101110

11111111
Given a WP install
11121112
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;}')"`
1113+
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;}')"`
11131114

1114-
When I try `wp search-replace current_field current_field1`
1115+
When I try `wp search-replace mysqli_result stdClass`
11151116
Then STDERR should contain:
11161117
"""
11171118
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.
11181119
"""
11191120
And STDOUT should contain:
11201121
"""
1121-
Success: Made 0 replacements.
1122+
Success: Made 1 replacement.
11221123
"""
11231124

1124-
When I run `wp db query "SELECT option_value from wp_options where option_name='cereal_isation'"`
1125+
When I run `wp db query "SELECT option_value from wp_options where option_name='cereal_isation_2'"`
11251126
Then STDOUT should contain:
11261127
"""
1127-
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;}
1128+
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;}
11281129
"""
11291130

11301131
Scenario: Regex search/replace with `--regex-limit=1` option

0 commit comments

Comments
 (0)