@@ -207,14 +207,14 @@ Feature: Do global search/replace
207
207
And a setup-theme-mod.php file:
208
208
"""
209
209
<?php
210
- set_theme_mod( 'header_image_data', (object) array( 'url' => 'http ://subdomain.example.com/foo.jpg' ) );
210
+ set_theme_mod( 'header_image_data', (object) array( 'url' => 'https ://subdomain.example.com/foo.jpg' ) );
211
211
"""
212
212
And I run `wp eval-file setup-theme-mod.php`
213
213
214
214
When I run `wp theme mod get header_image_data`
215
215
Then STDOUT should be a table containing rows:
216
- | key | value |
217
- | header_image_data | {"url ":"http :\/\/subdomain .example .com \/foo .jpg "} |
216
+ | key | value |
217
+ | header_image_data | {"url ":"https :\/\/subdomain .example .com \/foo .jpg "} |
218
218
219
219
When I run `wp search-replace subdomain.example.com example.com --no-recurse-objects`
220
220
Then STDOUT should be a table containing rows:
@@ -228,32 +228,32 @@ Feature: Do global search/replace
228
228
229
229
When I run `wp theme mod get header_image_data`
230
230
Then STDOUT should be a table containing rows:
231
- | key | value |
232
- | header_image_data | {"url ":"http :\/\/example .com \/foo .jpg "} |
231
+ | key | value |
232
+ | header_image_data | {"url ":"https :\/\/example .com \/foo .jpg "} |
233
233
234
234
Scenario : Search and replace with quoted strings
235
235
Given a WP install
236
236
237
- When I run `wp post create --post_content='<a href="http ://apple.com">Apple</a>' --porcelain`
237
+ When I run `wp post create --post_content='<a href="https ://apple.com">Apple</a>' --porcelain`
238
238
Then save STDOUT as {POST_ID}
239
239
240
240
When I run `wp post get {POST_ID} --field=content`
241
241
Then STDOUT should be:
242
242
"""
243
- <a href="http ://apple.com">Apple</a>
243
+ <a href="https ://apple.com">Apple</a>
244
244
"""
245
245
246
- When I run `wp search-replace '<a href="http ://apple.com">Apple</a>' '<a href="http ://google.com">Google</a>' --dry-run`
246
+ When I run `wp search-replace '<a href="https ://apple.com">Apple</a>' '<a href="https ://google.com">Google</a>' --dry-run`
247
247
Then STDOUT should be a table containing rows:
248
248
| Table | Column | Replacements | Type |
249
249
| wp_posts | post_content | 1 | SQL |
250
250
251
- When I run `wp search-replace '<a href="http ://apple.com">Apple</a>' '<a href="http ://google.com">Google</a>' `
251
+ When I run `wp search-replace '<a href="https ://apple.com">Apple</a>' '<a href="https ://google.com">Google</a>' `
252
252
Then STDOUT should be a table containing rows:
253
253
| Table | Column | Replacements | Type |
254
254
| wp_posts | post_content | 1 | SQL |
255
255
256
- When I run `wp search-replace '<a href="http ://google.com">Google</a>' '<a href="http ://apple.com">Apple</a>' --dry-run`
256
+ When I run `wp search-replace '<a href="https ://google.com">Google</a>' '<a href="https ://apple.com">Apple</a>' --dry-run`
257
257
Then STDOUT should contain:
258
258
"""
259
259
1 replacement to be made.
@@ -262,7 +262,7 @@ Feature: Do global search/replace
262
262
When I run `wp post get {POST_ID} --field=content`
263
263
Then STDOUT should be:
264
264
"""
265
- <a href="http ://google.com">Google</a>
265
+ <a href="https ://google.com">Google</a>
266
266
"""
267
267
268
268
Scenario : Search and replace with the same terms
@@ -303,16 +303,16 @@ Feature: Do global search/replace
303
303
| wp_posts | guid | 20 | SQL |
304
304
305
305
Examples :
306
- | replacement | flags |
307
- | {SITEURL }/subdir | |
308
- | http ://newdomain .com | |
309
- | http ://newdomain .com | --dry -run |
306
+ | replacement | flags |
307
+ | {SITEURL }/subdir | |
308
+ | https ://newdomain .com | |
309
+ | https ://newdomain .com | --dry -run |
310
310
311
311
Scenario Outline : Choose replacement method (PHP or MySQL/MariaDB) given proper flags or data.
312
312
Given a WP install
313
313
And I run `wp option get siteurl`
314
314
And save STDOUT as {SITEURL}
315
- When I run `wp search-replace <flags> {SITEURL} http ://wordpress.org`
315
+ When I run `wp search-replace <flags> {SITEURL} https ://wordpress.org`
316
316
317
317
Then STDOUT should be a table containing rows:
318
318
| Table | Column | Replacements | Type |
@@ -357,7 +357,7 @@ Feature: Do global search/replace
357
357
When I run `wp option get home`
358
358
Then STDOUT should be:
359
359
"""
360
- http ://example.com
360
+ https ://example.com
361
361
"""
362
362
363
363
When I run `wp search-replace 'EXAMPLE.com' 'BAXAMPLE.com' wp_options --regex --regex-flags=i`
@@ -368,38 +368,38 @@ Feature: Do global search/replace
368
368
When I run `wp option get home`
369
369
Then STDOUT should be:
370
370
"""
371
- http ://BAXAMPLE.com
371
+ https ://BAXAMPLE.com
372
372
"""
373
373
374
374
Scenario : Search replace with a regex delimiter
375
375
Given a WP install
376
376
377
- When I run `wp search-replace 'HTTP ://EXAMPLE.COM' 'http ://example.jp/' wp_options --regex --regex-flags=i --regex-delimiter='#' `
377
+ When I run `wp search-replace 'HTTPS ://EXAMPLE.COM' 'https ://example.jp/' wp_options --regex --regex-flags=i --regex-delimiter='#' `
378
378
Then STDOUT should be a table containing rows:
379
379
| Table | Column | Replacements | Type |
380
380
| wp_options | option_value | 2 | PHP |
381
381
382
382
When I run `wp option get home`
383
383
Then STDOUT should be:
384
384
"""
385
- http ://example.jp
385
+ https ://example.jp
386
386
"""
387
387
388
- When I run `wp search-replace 'http ://example.jp/' 'http ://example.com/' wp_options --regex-delimiter='/' `
388
+ When I run `wp search-replace 'https ://example.jp/' 'https ://example.com/' wp_options --regex-delimiter='/' `
389
389
Then STDOUT should be a table containing rows:
390
390
| Table | Column | Replacements | Type |
391
391
| wp_options | option_value | 2 | PHP |
392
392
393
393
When I run `wp option get home`
394
394
Then STDOUT should be:
395
395
"""
396
- http ://example.com
396
+ https ://example.com
397
397
"""
398
398
399
- When I try `wp search-replace 'HTTP ://EXAMPLE.COM' 'http ://example.jp/' wp_options --regex --regex-flags=i --regex-delimiter='1' `
399
+ When I try `wp search-replace 'HTTPS ://EXAMPLE.COM' 'https ://example.jp/' wp_options --regex --regex-flags=i --regex-delimiter='1' `
400
400
Then STDERR should be:
401
401
"""
402
- Error: The regex '1HTTP ://EXAMPLE.COM1i' fails.
402
+ Error: The regex '1HTTPS ://EXAMPLE.COM1i' fails.
403
403
preg_match(): Delimiter must not be alphanumeric or backslash.
404
404
"""
405
405
And the return code should be 1
0 commit comments