Skip to content

Commit 60ee553

Browse files
authored
Merge pull request #257 from wp-cli/fix/trunk-tests
Update tests after change in WP trunk
2 parents bf741eb + d8e7039 commit 60ee553

File tree

1 file changed

+50
-32
lines changed

1 file changed

+50
-32
lines changed

features/db-search.feature

+50-32
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ Feature: Search through the database
2424
4:example.com example.com
2525
"""
2626

27+
When I run `wp db query "SELECT option_id FROM wp_options WHERE option_name = 'siteurl';" --skip-column-names | cat`
28+
Then save STDOUT as {SITEURL_ID}
29+
2730
When I run `wp db search example.com`
2831
Then STDOUT should contain:
2932
"""
3033
wp_options:option_value
31-
1:https://example.com
34+
{SITEURL_ID}:https://example.com
3235
"""
3336
And STDOUT should not contain:
3437
"""
@@ -44,7 +47,7 @@ Feature: Search through the database
4447
Then STDOUT should contain:
4548
"""
4649
wp_options:option_value
47-
1:https://example.com
50+
{SITEURL_ID}:https://example.com
4851
"""
4952
And STDOUT should not contain:
5053
"""
@@ -60,7 +63,7 @@ Feature: Search through the database
6063
Then STDOUT should contain:
6164
"""
6265
wp_options:option_value
63-
1:example.com
66+
{SITEURL_ID}:example.com
6467
"""
6568
And STDOUT should not contain:
6669
"""
@@ -79,7 +82,7 @@ Feature: Search through the database
7982
Then STDOUT should contain:
8083
"""
8184
wp_options:option_value
82-
1:example.com
85+
{SITEURL_ID}:example.com
8386
"""
8487
And STDOUT should contain:
8588
"""
@@ -105,7 +108,7 @@ Feature: Search through the database
105108
Then STDOUT should contain:
106109
"""
107110
wp_options:option_value
108-
1:example.com
111+
{SITEURL_ID}:example.com
109112
"""
110113
And STDOUT should not contain:
111114
"""
@@ -121,7 +124,7 @@ Feature: Search through the database
121124
Then STDOUT should contain:
122125
"""
123126
wp_options:option_value
124-
1:example.com
127+
{SITEURL_ID}:example.com
125128
"""
126129
And STDOUT should not contain:
127130
"""
@@ -148,7 +151,7 @@ Feature: Search through the database
148151
Then STDOUT should contain:
149152
"""
150153
wp_options:option_value
151-
1:example.com
154+
{SITEURL_ID}:example.com
152155
"""
153156
And STDOUT should contain:
154157
"""
@@ -174,7 +177,7 @@ Feature: Search through the database
174177
Then STDOUT should contain:
175178
"""
176179
wp_options:option_value
177-
1:example.com
180+
{SITEURL_ID}:example.com
178181
"""
179182
And STDOUT should contain:
180183
"""
@@ -290,6 +293,9 @@ Feature: Search through the database
290293
And I run `wp db query "CREATE TABLE pw_options ( id int(11) unsigned NOT NULL AUTO_INCREMENT, awesome_stuff TEXT, PRIMARY KEY (id) );"`
291294
And I run `wp db query "INSERT INTO pw_options (awesome_stuff) VALUES ('example.com'), ('e_ample.c%m');"`
292295

296+
When I run `wp db query "SELECT option_id FROM wp_options WHERE option_name = 'siteurl';" --skip-column-names | cat`
297+
Then save STDOUT as {SITEURL_ID}
298+
293299
When I run `wp db query "SELECT CONCAT( id, ':', awesome_stuff) FROM wp_not ORDER BY id;" --skip-column-names`
294300
Then STDOUT should be:
295301
"""
@@ -313,7 +319,7 @@ Feature: Search through the database
313319
Then STDOUT should contain:
314320
"""
315321
wp_options:option_value
316-
1:https://example.com
322+
{SITEURL_ID}:https://example.com
317323
"""
318324
And STDOUT should not contain:
319325
"""
@@ -337,7 +343,7 @@ Feature: Search through the database
337343
Then STDOUT should contain:
338344
"""
339345
wp_options:option_value
340-
1:https://example.com
346+
{SITEURL_ID}:https://example.com
341347
"""
342348
And STDOUT should not contain:
343349
"""
@@ -385,12 +391,12 @@ Feature: Search through the database
385391
Then STDOUT should contain:
386392
"""
387393
wp_options:option_value
388-
1:https://example.com
394+
{SITEURL_ID}:https://example.com
389395
"""
390396
And STDOUT should contain:
391397
"""
392398
wp_2_options:option_value
393-
1:https://example.com/foo
399+
{SITEURL_ID}:https://example.com/foo
394400
"""
395401
And STDOUT should not contain:
396402
"""
@@ -410,7 +416,7 @@ Feature: Search through the database
410416
Then STDOUT should contain:
411417
"""
412418
wp_options:option_value
413-
1:https://example.com
419+
{SITEURL_ID}:https://example.com
414420
"""
415421
And STDOUT should not contain:
416422
"""
@@ -434,7 +440,7 @@ Feature: Search through the database
434440
Then STDOUT should contain:
435441
"""
436442
wp_options:option_value
437-
1:https://example.com
443+
{SITEURL_ID}:https://example.com
438444
"""
439445
And STDOUT should contain:
440446
"""
@@ -461,7 +467,7 @@ Feature: Search through the database
461467
Then STDOUT should contain:
462468
"""
463469
wp_options:option_value
464-
1:https://example.com
470+
{SITEURL_ID}:https://example.com
465471
"""
466472
And STDOUT should not contain:
467473
"""
@@ -510,7 +516,7 @@ Feature: Search through the database
510516
Then STDOUT should contain:
511517
"""
512518
wp_options:option_value
513-
1:https://example.com
519+
{SITEURL_ID}:https://example.com
514520
"""
515521
And STDOUT should contain:
516522
"""
@@ -538,7 +544,7 @@ Feature: Search through the database
538544
Then STDOUT should contain:
539545
"""
540546
wp_options:option_value
541-
1:https://example.com
547+
{SITEURL_ID}:https://example.com
542548
"""
543549
And STDOUT should contain:
544550
"""
@@ -705,6 +711,9 @@ Feature: Search through the database
705711

706712
Scenario: Search with regular expressions
707713
Given a WP install
714+
When I run `wp db query "SELECT option_id FROM wp_options WHERE option_name = 'siteurl';" --skip-column-names | cat`
715+
Then save STDOUT as {SITEURL_ID}
716+
708717
And I run `wp option update regextst '12345é789あhttps://regextst.com1234567890123456789éhttps://regextst.com12345678901234567890regextst.com34567890t.com67890'`
709718
# Note ö is o with combining umlaut.
710719
And I run `wp option update regextst_combining 'lllllムnöppppp'`
@@ -713,7 +722,7 @@ Feature: Search through the database
713722
Then STDOUT should contain:
714723
"""
715724
wp_options:option_value
716-
1:https://example.com
725+
{SITEURL_ID}:https://example.com
717726
"""
718727
And STDOUT should not contain:
719728
"""
@@ -865,35 +874,41 @@ Feature: Search through the database
865874
Scenario: Search with output options
866875
Given a WP install
867876

877+
When I run `wp db query "SELECT option_id FROM wp_options WHERE option_name = 'siteurl';" --skip-column-names | cat`
878+
Then save STDOUT as {SITEURL_ID}
879+
880+
When I run `wp db query "SELECT option_id FROM wp_options WHERE option_name = 'home';" --skip-column-names | cat`
881+
Then save STDOUT as {HOMEURL_ID}
882+
868883
When I run `wp db search example.com`
869884
Then STDOUT should contain:
870885
"""
871886
wp_options:option_value
872-
1:https://example.com
887+
{SITEURL_ID}:https://example.com
873888
wp_options:option_value
874-
2:https://example.com
889+
{HOMEURL_ID}:https://example.com
875890
"""
876891

877892
When I run `wp db search example.com --table_column_once`
878893
Then STDOUT should contain:
879894
"""
880895
wp_options:option_value
881-
1:https://example.com
882-
2:https://example.com
896+
{SITEURL_ID}:https://example.com
897+
{HOMEURL_ID}:https://example.com
883898
"""
884899

885900
When I run `wp db search example.com --one_line`
886901
Then STDOUT should contain:
887902
"""
888-
wp_options:option_value:1:https://example.com
889-
wp_options:option_value:2:https://example.com
903+
wp_options:option_value:{SITEURL_ID}:https://example.com
904+
wp_options:option_value:{HOMEURL_ID}:https://example.com
890905
"""
891906

892907
When I run `wp db search example.com --table_column_once --one_line`
893908
Then STDOUT should contain:
894909
"""
895-
wp_options:option_value:1:https://example.com
896-
wp_options:option_value:2:https://example.com
910+
wp_options:option_value:{SITEURL_ID}:https://example.com
911+
wp_options:option_value:{HOMEURL_ID}:https://example.com
897912
"""
898913

899914
When I run `wp db search example.com --all-tables --before_context=0 --after_context=0 --matches_only`
@@ -917,46 +932,49 @@ Feature: Search through the database
917932
Scenario: Search with custom colors
918933
Given a WP install
919934

935+
When I run `wp db query "SELECT option_id FROM wp_options WHERE option_name = 'siteurl';" --skip-column-names | cat`
936+
Then save STDOUT as {SITEURL_ID}
937+
920938
When I run `SHELL_PIPE=0 wp db search example.com`
921939
Then STDOUT should strictly contain:
922940
"""
923941
wp_options:option_value
924-
[33;1m1[0m:https://[43m[30mexample.com[0m
942+
[33;1m{SITEURL_ID}[0m:https://[43m[30mexample.com[0m
925943
"""
926944

927945
When I run `SHELL_PIPE=0 wp db search example.com --table_column_color=%r --id_color=%g --match_color=%b`
928946
Then STDOUT should strictly contain:
929947
"""
930948
wp_options:option_value
931-
[32m1[0m:https://[34mexample.com[0m
949+
[32m{SITEURL_ID}[0m:https://[34mexample.com[0m
932950
"""
933951

934952
When I run `SHELL_PIPE=0 wp db search example.com --table_column_color=%r`
935953
Then STDOUT should strictly contain:
936954
"""
937955
wp_options:option_value
938-
[33;1m1[0m:https://[43m[30mexample.com[0m
956+
[33;1m{SITEURL_ID}[0m:https://[43m[30mexample.com[0m
939957
"""
940958

941959
When I run `SHELL_PIPE=0 wp db search example.com --id_color=%g`
942960
Then STDOUT should strictly contain:
943961
"""
944962
wp_options:option_value
945-
[32m1[0m:https://[43m[30mexample.com[0m
963+
[32m{SITEURL_ID}[0m:https://[43m[30mexample.com[0m
946964
"""
947965

948966
When I run `SHELL_PIPE=0 wp db search example.com --match_color=%b`
949967
Then STDOUT should strictly contain:
950968
"""
951969
wp_options:option_value
952-
[33;1m1[0m:https://[34mexample.com[0m
970+
[33;1m{SITEURL_ID}[0m:https://[34mexample.com[0m
953971
"""
954972

955973
When I run `SHELL_PIPE=0 wp db search example.com --before_context=0 --after_context=0`
956974
Then STDOUT should strictly contain:
957975
"""
958976
wp_options:option_value
959-
[33;1m1[0m:example.com
977+
[33;1m{SITEURL_ID}[0m:example.com
960978
"""
961979

962980
When I try `wp db search example.com --match_color=%x`

0 commit comments

Comments
 (0)