You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/search-replace.feature
+44-3Lines changed: 44 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1106,16 +1106,57 @@ Feature: Do global search/replace
1106
1106
a:1:{i:0;O:10:"CornFlakes":0:{}}
1107
1107
"""
1108
1108
1109
-
@less-than-php-8.1
1110
-
Scenario: Warn and ignore type-hinted objects that have some error in deserialization (PHP < 8.1)
1109
+
@less-than-php-8.0
1110
+
Scenario: Warn and ignore type-hinted objects that have some error in deserialization (PHP < 8.0)
1111
1111
Given a WP install
1112
1112
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
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;}')"`
1114
1114
1115
1115
When I try `wp search-replace mysqli_result stdClass`
1116
1116
Then STDERR should contain:
1117
1117
"""
1118
-
Warning: Warning: Skipping an inconvertible serialized object of type "mysqli_result", replacements might not be complete. Reason: mysqli_result object is already closed.
1118
+
Warning: Skipping an inconvertible serialized object of type "mysqli_result", replacements might not be complete. Reason: mysqli_result object is already closed.
1119
+
"""
1120
+
And STDOUT should contain:
1121
+
"""
1122
+
Success: Made 1 replacement.
1123
+
"""
1124
+
1125
+
When I run `wp db query "SELECT option_value from wp_options where option_name='cereal_isation_2'" --skip-column-names`
Scenario: Warn and ignore type-hinted objects that have some error in deserialization (PHP 8.0)
1152
+
Given a WP install
1153
+
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;}')"`
1154
+
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;}')"`
1155
+
1156
+
When I try `wp search-replace mysqli_result stdClass`
1157
+
Then STDERR should contain:
1158
+
"""
1159
+
Warning: Skipping an inconvertible serialized object of type "mysqli_result", replacements might not be complete. Reason: mysqli_result object is already closed.
0 commit comments