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
Scenario: Search and replace handles JSON-encoded URLs in post content
243
+
Given a WP install
244
+
245
+
When I run `wp post create --post_content='{"src":"http:\/\/example.com\/wp-content\/uploads\/fonts\/test.woff2","fontWeight":"400"}' --post_status=publish --porcelain`
246
+
Then save STDOUT as {POST_ID}
247
+
248
+
When I run `wp post get {POST_ID} --field=post_content`
249
+
Then STDOUT should contain:
250
+
"""
251
+
http:\/\/example.com
252
+
"""
253
+
254
+
When I run `wp search-replace 'http://example.com''http://newdomain.com' wp_posts --include-columns=post_content`
255
+
Then STDOUT should be a table containing rows:
256
+
| Table | Column | Replacements | Type |
257
+
| wp_posts | post_content | 1 | SQL |
258
+
259
+
When I run `wp post get {POST_ID} --field=post_content`
260
+
Then STDOUT should contain:
261
+
"""
262
+
http:\/\/newdomain.com
263
+
"""
264
+
And STDOUT should not contain:
265
+
"""
266
+
http:\/\/example.com
267
+
"""
268
+
269
+
When I run `wp search-replace 'http://newdomain.com''http://example.com' wp_posts --include-columns=post_content --precise`
270
+
Then STDOUT should be a table containing rows:
271
+
| Table | Column | Replacements | Type |
272
+
| wp_posts | post_content | 1 | PHP |
273
+
274
+
When I run `wp post get {POST_ID} --field=post_content`
0 commit comments