Skip to content

Commit d7515cf

Browse files
committed
Update: fix tests
1 parent ce21121 commit d7515cf

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"wp-cli/wp-cli": "^2.5"
2929
},
3030
"require-dev": {
31-
"wp-cli/wp-cli-tests": "^4"
31+
"wp-cli/wp-cli-tests": "dev-main"
3232
},
3333
"scripts": {
3434
"behat": "run-behat-tests",

‎features/bootstrap/SQLiteFeatureContext.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Behat\Gherkin\Node\PyStringNode;
88
use WP_CLI\Tests\Context\FeatureContext as WPCLIFeatureContext;
99
use SQLite3;
10+
use Exception;
1011

1112
class SQLiteFeatureContext extends WPCLIFeatureContext implements Context {
1213

‎features/sqlite_export.feature‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ Feature: WP-CLI SQLite Export Command
3636
And the file "test_export_specific.sql" should exist
3737
And the file "test_export_specific.sql" should contain:
3838
"""
39-
CREATE TABLE wp_posts
39+
CREATE TABLE `wp_posts`
4040
"""
4141
And the file "test_export_specific.sql" should contain:
4242
"""
43-
CREATE TABLE wp_users
43+
CREATE TABLE `wp_users`
4444
"""
4545
But the file "test_export_specific.sql" should not contain:
4646
"""
47-
CREATE TABLE wp_options
47+
CREATE TABLE `wp_options`
4848
"""
4949

5050
@require-sqlite
@@ -58,15 +58,15 @@ Feature: WP-CLI SQLite Export Command
5858
And the file "test_export_exclude.sql" should exist
5959
And the file "test_export_exclude.sql" should not contain:
6060
"""
61-
CREATE TABLE wp_posts
61+
CREATE TABLE `wp_posts``
6262
"""
6363
And the file "test_export_exclude.sql" should not contain:
6464
"""
65-
CREATE TABLE wp_users
65+
CREATE TABLE `wp_users``
6666
"""
6767
But the file "test_export_exclude.sql" should contain:
6868
"""
69-
CREATE TABLE wp_options
69+
CREATE TABLE `wp_options`
7070
"""
7171

7272
@require-sqlite
@@ -105,13 +105,13 @@ Feature: WP-CLI SQLite Export Command
105105
And the file "test_export_both.sql" should exist
106106
And the file "test_export_both.sql" should contain:
107107
"""
108-
CREATE TABLE wp_posts
108+
CREATE TABLE `wp_posts`
109109
"""
110110
And the file "test_export_both.sql" should contain:
111111
"""
112-
CREATE TABLE wp_options
112+
CREATE TABLE `wp_options`
113113
"""
114114
But the file "test_export_both.sql" should not contain:
115115
"""
116-
CREATE TABLE wp_users
116+
CREATE TABLE `wp_users`
117117
"""

‎src/SQLite_Command.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SQLite_Command extends WP_CLI_Command {
2121
* $ wp sqlite import wordpress_dbase.sql
2222
* Success: Imported from 'import wordpress_dbase.sql'.
2323
*
24-
* @when after_wp_load
24+
* @when before_wp_load
2525
*/
2626
public function import( $args, $assoc_args ) {
2727

@@ -76,7 +76,7 @@ public function import( $args, $assoc_args ) {
7676
* $ wp sqlite export --exclude_tables=wp_posts,wp_users
7777
* Success: Exported to 'wordpress_dbase.sql'.
7878
*
79-
* @when after_wp_load
79+
* @when before_wp_load
8080
*/
8181
public function export( $args, $assoc_args ) {
8282
$is_porcelain = isset( $assoc_args['porcelain'] );

0 commit comments

Comments
 (0)