Skip to content

Commit

Permalink
Load PHPUnit 6 compat shim from WP
Browse files Browse the repository at this point in the history
If needed.

Fixes #19
  • Loading branch information
JDGrimes authored Nov 14, 2017
1 parent 8051ccd commit 619c90d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/WPPPB/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public static function instance() {
* @since 0.1.0
*/
protected function __construct() {

$this->phpunit_compat();

if ( $this->should_install_plugins() ) {
$this->hook_up_installer();
}
Expand Down Expand Up @@ -216,6 +219,23 @@ public function locate_wp_tests_config() {
return $config_file_path;
}

/**
* Ensures compatibility with the current PHPUnit version.
*
* @since 0.3.2
*/
public function phpunit_compat() {

if ( class_exists( 'PHPUnit\Runner\Version' ) ) {
/**
* Compatibility with PHPUnit 6+.
*
* @since 0.3.2
*/
require_once $this->get_wp_tests_dir() . '/includes/phpunit6-compat.php';
}
}

/**
* Check whether the plugins should be installed.
*
Expand Down

0 comments on commit 619c90d

Please sign in to comment.