Skip to content

Commit ba1868f

Browse files
committed
Add regression test to check behavior with incomplete classes
1 parent f8ca203 commit ba1868f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

features/search-replace.feature

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,3 +1030,25 @@ Feature: Do global search/replace
10301030
"""
10311031
Success: 1 replacement to be made.
10321032
"""
1033+
1034+
# Regression test for https://github.com/wp-cli/search-replace-command/issues/68
1035+
Scenario: Incomplete classes are handled gracefully during (un)serialization
1036+
1037+
Given a WP install
1038+
And I run `wp option add cereal_isation 'a:1:{i:0;O:10:"CornFlakes":0:{}}'`
1039+
1040+
When I try `wp search-replace CornFlakes Smacks`
1041+
Then STDERR should contain:
1042+
"""
1043+
Warning: Skipping an uninitialized class "CornFlakes", replacements might not be complete.
1044+
"""
1045+
And STDOUT should contain:
1046+
"""
1047+
Success: Made 0 replacements.
1048+
"""
1049+
1050+
When I run `wp option get cereal_isation`
1051+
Then STDOUT should contain:
1052+
"""
1053+
a:1:{i:0;O:10:"CornFlakes":0:{}}
1054+
"""

0 commit comments

Comments
 (0)