Skip to content

Commit ce21121

Browse files
committed
Update: Run tests only on sqlite dbtype
1 parent 7418e01 commit ce21121

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎features/bootstrap/SQLiteFeatureContext.php‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ class SQLiteFeatureContext extends WPCLIFeatureContext implements Context {
1212

1313
private $db;
1414

15-
public function __construct() {
16-
putenv( 'WP_CLI_TEST_DBTYPE=sqlite' );
17-
parent::__construct();
18-
}
19-
2015
/**
2116
* @Given /^a SQL dump file named "([^"]*)" with content:$/
2217
*/

‎features/sqlite_export.feature‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Feature: WP-CLI SQLite Export Command
77
Given a WP installation
88
And the SQLite database contains some sample data
99

10+
@require-sqlite
1011
Scenario: Successfully export the entire SQLite database
1112
When I run `wp sqlite export test_export.sql`
1213
Then STDOUT should contain:
@@ -24,6 +25,7 @@ Feature: WP-CLI SQLite Export Command
2425
INSERT INTO
2526
"""
2627

28+
@require-sqlite
2729
Scenario: Export specific tables
2830
When I run `wp sqlite export test_export_specific.sql --tables=wp_posts,wp_users`
2931
Then STDOUT should contain:
@@ -45,6 +47,7 @@ Feature: WP-CLI SQLite Export Command
4547
CREATE TABLE wp_options
4648
"""
4749

50+
@require-sqlite
4851
Scenario: Export all tables except specific ones
4952
When I run `wp sqlite export test_export_exclude.sql --exclude_tables=wp_posts,wp_users`
5053
Then STDOUT should contain:
@@ -66,6 +69,7 @@ Feature: WP-CLI SQLite Export Command
6669
CREATE TABLE wp_options
6770
"""
6871

72+
@require-sqlite
6973
Scenario: Export to STDOUT
7074
When I run `wp sqlite export -`
7175
Then STDOUT should contain:
@@ -81,6 +85,7 @@ Feature: WP-CLI SQLite Export Command
8185
INSERT INTO
8286
"""
8387

88+
@require-sqlite
8489
Scenario: Export with porcelain flag
8590
When I run `wp sqlite export --porcelain`
8691
Then STDOUT should match /^[\w-]+\.sql$/
@@ -89,6 +94,7 @@ Feature: WP-CLI SQLite Export Command
8994
Success: Exporting database...
9095
"""
9196

97+
@require-sqlite
9298
Scenario: Export with both --tables and --exclude_tables
9399
When I run `wp sqlite export test_export_both.sql --tables=wp_posts,wp_users,wp_options --exclude_tables=wp_users`
94100
Then STDOUT should contain:

‎features/sqlite_import.feature‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Feature: WP-CLI SQLite Import Command
66
Background:
77
Given a WP installation
88

9+
@require-sqlite
910
Scenario: Successfully import a SQLite database
1011
Given a SQL dump file named "test_import.sql" with content:
1112
"""
@@ -20,6 +21,7 @@ Feature: WP-CLI SQLite Import Command
2021
And the SQLite database should contain a table named "test_table"
2122
And the "test_table" should contain a row with name "Test Name"
2223

24+
@require-sqlite
2325
Scenario: Attempt to import without specifying a file
2426
When I try `wp sqlite import`
2527
Then STDOUT should contain:
@@ -28,6 +30,7 @@ Feature: WP-CLI SQLite Import Command
2830
"""
2931
And the return code should be 1
3032

33+
@require-sqlite
3134
Scenario: Import from STDIN
3235
Given a SQL dump file named "test_import.sql" with content:
3336
"""

0 commit comments

Comments
 (0)