Skip to content

Commit 73aad75

Browse files
committed
Move tests
1 parent 0814b9c commit 73aad75

3 files changed

Lines changed: 65 additions & 110 deletions

File tree

features/db-check.feature

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ Feature: Check the database
1313
Success: Database checked.
1414
"""
1515

16+
Scenario: db check with --quiet flag should only show errors
17+
Given a WP install
18+
19+
When I run `wp db check --quiet`
20+
Then STDOUT should be empty
21+
22+
Scenario: db check can explicitly pass --silent to mysqlcheck
23+
Given a WP install
24+
25+
When I run `wp db check --silent`
26+
Then STDOUT should not contain:
27+
"""
28+
wp_cli_test.wp_users
29+
"""
30+
And STDOUT should contain:
31+
"""
32+
Success: Database checked.
33+
"""
34+
1635
Scenario: Run db check with MySQL defaults to check the database
1736
Given a WP install
1837

features/db-quiet.feature

Lines changed: 0 additions & 109 deletions
This file was deleted.

features/db.feature

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,51 @@ Feature: Perform database operations
185185
"""
186186
And STDOUT should not be empty
187187
188+
Scenario: db optimize with --quiet flag should only show errors
189+
Given a WP install
190+
191+
When I run `wp db optimize --quiet`
192+
Then STDOUT should not contain:
193+
"""
194+
error
195+
"""
196+
197+
198+
Scenario: db optimize can explicitly pass --silent to mysqlcheck
199+
Given a WP install
200+
201+
When I run `wp db optimize --silent`
202+
Then STDOUT should not contain:
203+
"""
204+
wp_cli_test.wp_users
205+
"""
206+
And STDOUT should contain:
207+
"""
208+
Success: Database optimized.
209+
"""
210+
211+
Scenario: db repair with --quiet flag should only show errors
212+
Given a WP install
213+
214+
When I run `wp db repair --quiet`
215+
Then STDOUT should not contain:
216+
"""
217+
error
218+
"""
219+
220+
Scenario: db repair can explicitly pass --silent to mysqlcheck
221+
Given a WP install
222+
223+
When I run `wp db repair --silent`
224+
Then STDOUT should not contain:
225+
"""
226+
error
227+
"""
228+
And STDOUT should contain:
229+
"""
230+
Success: Database repaired.
231+
"""
232+
188233
Scenario: DB Query
189234
Given a WP install
190235
@@ -334,7 +379,7 @@ Feature: Perform database operations
334379
"""
335380
Query succeeded. Rows affected: 1
336381
"""
337-
382+
338383
When I run `wp db query "SELECT * FROM wp_users WHERE ID = 1"`
339384
Then STDOUT should not contain:
340385
"""

0 commit comments

Comments
 (0)