Skip to content

Commit

Permalink
Fix SQLite integration with composer installs (#192)
Browse files Browse the repository at this point in the history
Adds a test in this repo so we don’t have to find out by looking at other repos
  • Loading branch information
swissspidy authored Nov 10, 2023
1 parent 4123df6 commit 0601666
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions features/testing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ Feature: Test that WP-CLI loads.
"""
sqlite
"""

@require-sqlite
Scenario: Composer installation
Given a WP install with Composer

When I run `wp eval 'echo DB_ENGINE;'`
Then STDOUT should contain:
"""
sqlite
"""
5 changes: 5 additions & 0 deletions src/Context/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,12 @@ public function install_wp_with_composer( $vendor_directory = 'vendor' ) {
'skip-email' => true,
];

if ( ! is_dir( $this->variables['RUN_DIR'] . '/WordPress/wp-content/mu-plugins' ) ) {
mkdir( $this->variables['RUN_DIR'] . '/WordPress/wp-content/mu-plugins' );
}

if ( 'sqlite' === self::$db_type ) {
mkdir( $this->variables['RUN_DIR'] . '/WordPress/wp-content/mu-plugins/sqlite-database-integration' );
self::copy_dir( self::$sqlite_cache_dir, $this->variables['RUN_DIR'] . '/WordPress/wp-content/mu-plugins' );
self::configure_sqlite( $this->variables['RUN_DIR'] . '/WordPress' );
}
Expand Down

0 comments on commit 0601666

Please sign in to comment.