@@ -271,7 +271,7 @@ Feature: Do global search/replace
271
271
And I run `wp db query "INSERT INTO wp_multicol VALUES (1, 'foo', 'bar')" `
272
272
And I run `wp db query "INSERT INTO wp_multicol VALUES (2, 'bar', 'foo')" `
273
273
274
- When I run `wp search-replace bar replaced wp_multicol`
274
+ When I run `wp search-replace bar replaced wp_multicol --all-tables `
275
275
Then STDOUT should be a table containing rows:
276
276
| Table | Column | Replacements | Type |
277
277
| wp_multicol | name | 1 | SQL |
@@ -458,15 +458,15 @@ Feature: Do global search/replace
458
458
When I run `wp db query "SOURCE esc_sql_ident.sql;" `
459
459
Then STDERR should be empty
460
460
461
- When I run `wp search-replace 'v"vvvv_v' 'w"wwww_w' TABLE --format=count`
461
+ When I run `wp search-replace 'v"vvvv_v' 'w"wwww_w' TABLE --format=count --all-tables `
462
462
Then STDOUT should be:
463
463
"""
464
464
6
465
465
"""
466
466
And STDERR should be empty
467
467
468
468
# Regex uses wpdb::update() which can't handle backticks in field names so avoid `back``tick` column.
469
- When I run `wp search-replace 'w"wwww_w' 'v"vvvv_v' TABLE --regex --include-columns='VALUES,single' \''double"quote' --format=count`
469
+ When I run `wp search-replace 'w"wwww_w' 'v"vvvv_v' TABLE --regex --include-columns='VALUES,single' \''double"quote' --format=count --all-tables `
470
470
Then STDOUT should be:
471
471
"""
472
472
4
@@ -586,33 +586,16 @@ Feature: Do global search/replace
586
586
Scenario : Deal with non-existent table and table with no primary keys
587
587
Given a WP install
588
588
589
- When I run `wp search-replace foo bar no_such_table`
590
- Then STDOUT should contain:
591
- """
592
- Success: Made 0 replacements.
593
- """
594
- And STDOUT should end with a table containing rows:
595
- | Table | Column | Replacements | Type |
596
- | no_such_table | | skipped | |
597
- And STDERR should be empty
598
-
599
- When I try `wp search-replace foo bar no_such_table --no-report`
600
- Then STDOUT should contain:
601
- """
602
- Success: Made 0 replacements.
603
- """
604
- And STDOUT should not contain:
605
- """
606
- Table Column Replacements Type
607
- """
589
+ When I try `wp search-replace foo bar no_such_table --all-tables`
590
+ Then STDOUT should be empty
608
591
And STDERR should be:
609
592
"""
610
- Warning: No such table ' no_such_table'.
593
+ Error: Couldn't find any tables matching: no_such_table
611
594
"""
612
- And the return code should be 0
595
+ And the return code should be 1
613
596
614
597
When I run `wp db query "CREATE TABLE no_key ( awesome_stuff TEXT );" `
615
- And I run `wp search-replace foo bar no_key`
598
+ And I run `wp search-replace foo bar no_key --all-tables `
616
599
Then STDOUT should contain:
617
600
"""
618
601
Success: Made 0 replacements.
@@ -622,7 +605,7 @@ Feature: Do global search/replace
622
605
| no_key | | skipped | |
623
606
And STDERR should be empty
624
607
625
- And I run `wp search-replace foo bar no_key --report-changed-only`
608
+ And I run `wp search-replace foo bar no_key --report-changed-only --all-tables `
626
609
Then STDOUT should contain:
627
610
"""
628
611
Success: Made 0 replacements.
@@ -634,7 +617,7 @@ Feature: Do global search/replace
634
617
"""
635
618
And STDERR should be empty
636
619
637
- When I try `wp search-replace foo bar no_key --no-report`
620
+ When I try `wp search-replace foo bar no_key --no-report --all-tables `
638
621
Then STDOUT should contain:
639
622
"""
640
623
Success: Made 0 replacements.
0 commit comments