Skip to content

Commit

Permalink
Alias constraint class on PHPUnit 6
Browse files Browse the repository at this point in the history
Fixes #20
  • Loading branch information
JDGrimes authored Nov 15, 2017
1 parent 619c90d commit 4c34c16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/WPPPB/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,21 @@ public function locate_wp_tests_config() {
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';

if ( version_compare( PHPUnit\Runner\Version::id(), '6.0', '>=' ) ) {

class_alias(
'PHPUnit\Framework\Constraint\Constraint'
, 'PHPUnit_Framework_Constraint'
);
}
}
}

Expand Down

0 comments on commit 4c34c16

Please sign in to comment.