Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Ensure the WP_CONTENT_DIR is set the current project when running php…
Browse files Browse the repository at this point in the history
…unit in plugin dir
  • Loading branch information
westonruter committed Jul 6, 2016
1 parent 30b4b22 commit 20eba62
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions phpunit-plugin-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// Determine if we should update the content and plugin paths.
if ( file_exists( dirname( __DIR__ ) . '/wp-load.php' ) ) {
define( 'WP_CONTENT_DIR', dirname( __DIR__ ) . '/wp-content/' );
} else if ( file_exists( '../../../wp-content' ) ) {
define( 'WP_CONTENT_DIR', dirname( dirname( dirname( getcwd() ) ) ) . '/wp-content/' );
}
if ( defined( 'WP_CONTENT_DIR' ) && ! defined( 'WP_PLUGIN_DIR' ) ) {
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . 'plugins/' );
}

Expand Down

0 comments on commit 20eba62

Please sign in to comment.