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
Copy file name to clipboardExpand all lines: features/db-search.feature
+50-32
Original file line number
Diff line number
Diff line change
@@ -24,11 +24,14 @@ Feature: Search through the database
24
24
4:example.com example.com
25
25
"""
26
26
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
+
27
30
When I run `wp db search example.com`
28
31
Then STDOUT should contain:
29
32
"""
30
33
wp_options:option_value
31
-
1:https://example.com
34
+
{SITEURL_ID}:https://example.com
32
35
"""
33
36
And STDOUT should not contain:
34
37
"""
@@ -44,7 +47,7 @@ Feature: Search through the database
44
47
Then STDOUT should contain:
45
48
"""
46
49
wp_options:option_value
47
-
1:https://example.com
50
+
{SITEURL_ID}:https://example.com
48
51
"""
49
52
And STDOUT should not contain:
50
53
"""
@@ -60,7 +63,7 @@ Feature: Search through the database
60
63
Then STDOUT should contain:
61
64
"""
62
65
wp_options:option_value
63
-
1:example.com
66
+
{SITEURL_ID}:example.com
64
67
"""
65
68
And STDOUT should not contain:
66
69
"""
@@ -79,7 +82,7 @@ Feature: Search through the database
79
82
Then STDOUT should contain:
80
83
"""
81
84
wp_options:option_value
82
-
1:example.com
85
+
{SITEURL_ID}:example.com
83
86
"""
84
87
And STDOUT should contain:
85
88
"""
@@ -105,7 +108,7 @@ Feature: Search through the database
105
108
Then STDOUT should contain:
106
109
"""
107
110
wp_options:option_value
108
-
1:example.com
111
+
{SITEURL_ID}:example.com
109
112
"""
110
113
And STDOUT should not contain:
111
114
"""
@@ -121,7 +124,7 @@ Feature: Search through the database
121
124
Then STDOUT should contain:
122
125
"""
123
126
wp_options:option_value
124
-
1:example.com
127
+
{SITEURL_ID}:example.com
125
128
"""
126
129
And STDOUT should not contain:
127
130
"""
@@ -148,7 +151,7 @@ Feature: Search through the database
148
151
Then STDOUT should contain:
149
152
"""
150
153
wp_options:option_value
151
-
1:example.com
154
+
{SITEURL_ID}:example.com
152
155
"""
153
156
And STDOUT should contain:
154
157
"""
@@ -174,7 +177,7 @@ Feature: Search through the database
174
177
Then STDOUT should contain:
175
178
"""
176
179
wp_options:option_value
177
-
1:example.com
180
+
{SITEURL_ID}:example.com
178
181
"""
179
182
And STDOUT should contain:
180
183
"""
@@ -290,6 +293,9 @@ Feature: Search through the database
290
293
And I run `wp db query "CREATE TABLE pw_options ( id int(11) unsigned NOT NULL AUTO_INCREMENT, awesome_stuff TEXT, PRIMARY KEY (id) );"`
291
294
And I run `wp db query "INSERT INTO pw_options (awesome_stuff) VALUES ('example.com'), ('e_ample.c%m');"`
292
295
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
+
293
299
When I run `wp db query "SELECT CONCAT( id, ':', awesome_stuff) FROM wp_not ORDER BY id;" --skip-column-names`
294
300
Then STDOUT should be:
295
301
"""
@@ -313,7 +319,7 @@ Feature: Search through the database
313
319
Then STDOUT should contain:
314
320
"""
315
321
wp_options:option_value
316
-
1:https://example.com
322
+
{SITEURL_ID}:https://example.com
317
323
"""
318
324
And STDOUT should not contain:
319
325
"""
@@ -337,7 +343,7 @@ Feature: Search through the database
337
343
Then STDOUT should contain:
338
344
"""
339
345
wp_options:option_value
340
-
1:https://example.com
346
+
{SITEURL_ID}:https://example.com
341
347
"""
342
348
And STDOUT should not contain:
343
349
"""
@@ -385,12 +391,12 @@ Feature: Search through the database
385
391
Then STDOUT should contain:
386
392
"""
387
393
wp_options:option_value
388
-
1:https://example.com
394
+
{SITEURL_ID}:https://example.com
389
395
"""
390
396
And STDOUT should contain:
391
397
"""
392
398
wp_2_options:option_value
393
-
1:https://example.com/foo
399
+
{SITEURL_ID}:https://example.com/foo
394
400
"""
395
401
And STDOUT should not contain:
396
402
"""
@@ -410,7 +416,7 @@ Feature: Search through the database
410
416
Then STDOUT should contain:
411
417
"""
412
418
wp_options:option_value
413
-
1:https://example.com
419
+
{SITEURL_ID}:https://example.com
414
420
"""
415
421
And STDOUT should not contain:
416
422
"""
@@ -434,7 +440,7 @@ Feature: Search through the database
434
440
Then STDOUT should contain:
435
441
"""
436
442
wp_options:option_value
437
-
1:https://example.com
443
+
{SITEURL_ID}:https://example.com
438
444
"""
439
445
And STDOUT should contain:
440
446
"""
@@ -461,7 +467,7 @@ Feature: Search through the database
461
467
Then STDOUT should contain:
462
468
"""
463
469
wp_options:option_value
464
-
1:https://example.com
470
+
{SITEURL_ID}:https://example.com
465
471
"""
466
472
And STDOUT should not contain:
467
473
"""
@@ -510,7 +516,7 @@ Feature: Search through the database
510
516
Then STDOUT should contain:
511
517
"""
512
518
wp_options:option_value
513
-
1:https://example.com
519
+
{SITEURL_ID}:https://example.com
514
520
"""
515
521
And STDOUT should contain:
516
522
"""
@@ -538,7 +544,7 @@ Feature: Search through the database
538
544
Then STDOUT should contain:
539
545
"""
540
546
wp_options:option_value
541
-
1:https://example.com
547
+
{SITEURL_ID}:https://example.com
542
548
"""
543
549
And STDOUT should contain:
544
550
"""
@@ -705,6 +711,9 @@ Feature: Search through the database
705
711
706
712
Scenario: Search with regular expressions
707
713
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
+
708
717
And I run `wp option update regextst '12345é789あhttps://regextst.com1234567890123456789éhttps://regextst.com12345678901234567890regextst.com34567890t.com67890'`
709
718
# Note ö is o with combining umlaut.
710
719
And I run `wp option update regextst_combining 'lllllムnöppppp'`
@@ -713,7 +722,7 @@ Feature: Search through the database
713
722
Then STDOUT should contain:
714
723
"""
715
724
wp_options:option_value
716
-
1:https://example.com
725
+
{SITEURL_ID}:https://example.com
717
726
"""
718
727
And STDOUT should not contain:
719
728
"""
@@ -865,35 +874,41 @@ Feature: Search through the database
865
874
Scenario: Search with output options
866
875
Given a WP install
867
876
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
+
868
883
When I run `wp db search example.com`
869
884
Then STDOUT should contain:
870
885
"""
871
886
wp_options:option_value
872
-
1:https://example.com
887
+
{SITEURL_ID}:https://example.com
873
888
wp_options:option_value
874
-
2:https://example.com
889
+
{HOMEURL_ID}:https://example.com
875
890
"""
876
891
877
892
When I run `wp db search example.com --table_column_once`
0 commit comments