File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -41,3 +41,14 @@ Feature: Test that WP-CLI loads.
4141 """
4242 false
4343 """
44+
45+ @require-sqlite
46+ Scenario : Custom wp-content directory
47+ Given a WP install
48+ And a custom wp-content directory
49+
50+ When I run `wp eval 'echo DB_ENGINE;' `
51+ Then STDOUT should contain:
52+ """
53+ sqlite
54+ """
Original file line number Diff line number Diff line change @@ -176,6 +176,19 @@ public function given_a_custom_wp_directory() {
176176 );
177177
178178 file_put_contents ( $ wp_config_path , $ wp_config_code );
179+
180+ if ( 'sqlite ' === self ::$ db_type ) {
181+ $ db_dropin = $ this ->variables ['RUN_DIR ' ] . '/my-content/db.php ' ;
182+
183+ /* similar to https://github.com/WordPress/sqlite-database-integration/blob/3306576c9b606bc23bbb26c15383fef08e03ab11/activate.php#L95 */
184+ $ file_contents = str_replace (
185+ 'plugins/ ' ,
186+ '../my-plugins/ ' ,
187+ file_get_contents ( $ db_dropin )
188+ );
189+
190+ file_put_contents ( $ db_dropin , $ file_contents );
191+ }
179192 }
180193
181194 /**
You can’t perform that action at this time.
0 commit comments