Skip to content

Commit a8a4a9d

Browse files
Merge pull request #63 from wp-cli/db_drop_test
Add test for db drop.
2 parents f040d08 + 44c4039 commit a8a4a9d

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

features/db.feature

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Feature: Perform database operations
44
Given an empty directory
55
And WP files
66
And wp-config.php
7+
And a session_no file:
8+
"""
9+
n
10+
"""
711

812
When I try `wp option get home`
913
Then STDOUT should be empty
@@ -21,6 +25,21 @@ Feature: Perform database operations
2125
When I try the previous command again
2226
Then the return code should be 1
2327

28+
When I run `wp db drop --yes`
29+
Then STDOUT should be:
30+
"""
31+
Success: Database dropped.
32+
"""
33+
34+
When I try the previous command again
35+
Then the return code should be 1
36+
37+
When I run `wp db drop < session_no`
38+
Then STDOUT should be:
39+
"""
40+
Are you sure you want to drop the 'wp_cli_test' database? [y/n]
41+
"""
42+
2443
Scenario: DB Operations
2544
Given a WP install
2645
@@ -137,7 +156,7 @@ Feature: Perform database operations
137156
Then STDOUT should not be empty
138157
139158
When I run `wp db create`
140-
Then STDERR should be empty
159+
Then STDOUT should not be empty
141160
142161
When I run `wp core install --title="WP-CLI Test" --url=example.com --admin_user=admin --admin_password=admin [email protected]`
143162
Then STDOUT should not be empty

0 commit comments

Comments
 (0)