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
+3-34Lines changed: 3 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -1233,40 +1233,9 @@ Feature: Do global search/replace
1233
1233
Success: Made 1 replacement.
1234
1234
"""
1235
1235
1236
-
@require-mysql@less-than-php-8.0
1237
-
Scenario: Warn and ignore type-hinted objects that have some error in deserialization (PHP < 8.0)
1238
-
Given a WP install
1239
-
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;}')"`
1240
-
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;}')"`
1241
-
1242
-
When I try `wp search-replace mysqli_result stdClass`
1243
-
Then STDERR should contain:
1244
-
"""
1245
-
Warning: Skipping an uninitialized class "mysqli_result", replacements might not be complete.
1246
-
"""
1247
-
And STDOUT should contain:
1248
-
"""
1249
-
Success: Made 0 replacements.
1250
-
"""
1251
-
1252
-
@require-mysql@require-php-8.0@less-than-php-8.1
1253
-
Scenario: Warn and ignore type-hinted objects that have some error in deserialization (PHP 8.0)
1254
-
Given a WP install
1255
-
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;}')"`
1256
-
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;}')"`
1257
-
1258
-
When I try `wp search-replace mysqli_result stdClass`
1259
-
Then STDERR should contain:
1260
-
"""
1261
-
Warning: Skipping an uninitialized class "mysqli_result", replacements might not be complete.
1262
-
"""
1263
-
And STDOUT should contain:
1264
-
"""
1265
-
Success: Made 0 replacements.
1266
-
"""
1236
+
@require-mysql
1237
+
Scenario: Warn and ignore type-hinted objects that have some error in deserialization
1267
1238
1268
-
@require-mysql@require-php-8.1
1269
-
Scenario: Warn and ignore type-hinted objects that have some error in deserialization (PHP 8.1+)
1270
1239
Given a WP install
1271
1240
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;}')"`
1272
1241
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;}')"`
@@ -1278,7 +1247,7 @@ Feature: Do global search/replace
1278
1247
"""
1279
1248
And STDOUT should contain:
1280
1249
"""
1281
-
Success: Made 0 replacements.
1250
+
Success: Made 1 replacement.
1282
1251
"""
1283
1252
1284
1253
# See https://github.com/wp-cli/search-replace-command/issues/190
0 commit comments