Skip to content

Commit 0601666

Browse files
authored
Fix SQLite integration with composer installs (#192)
Adds a test in this repo so we don’t have to find out by looking at other repos
1 parent 4123df6 commit 0601666

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

features/testing.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,13 @@ Feature: Test that WP-CLI loads.
5252
"""
5353
sqlite
5454
"""
55+
56+
@require-sqlite
57+
Scenario: Composer installation
58+
Given a WP install with Composer
59+
60+
When I run `wp eval 'echo DB_ENGINE;'`
61+
Then STDOUT should contain:
62+
"""
63+
sqlite
64+
"""

src/Context/FeatureContext.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,12 @@ public function install_wp_with_composer( $vendor_directory = 'vendor' ) {
10911091
'skip-email' => true,
10921092
];
10931093

1094+
if ( ! is_dir( $this->variables['RUN_DIR'] . '/WordPress/wp-content/mu-plugins' ) ) {
1095+
mkdir( $this->variables['RUN_DIR'] . '/WordPress/wp-content/mu-plugins' );
1096+
}
1097+
10941098
if ( 'sqlite' === self::$db_type ) {
1099+
mkdir( $this->variables['RUN_DIR'] . '/WordPress/wp-content/mu-plugins/sqlite-database-integration' );
10951100
self::copy_dir( self::$sqlite_cache_dir, $this->variables['RUN_DIR'] . '/WordPress/wp-content/mu-plugins' );
10961101
self::configure_sqlite( $this->variables['RUN_DIR'] . '/WordPress' );
10971102
}

0 commit comments

Comments
 (0)