Skip to content

Commit 4c34c16

Browse files
authored
Alias constraint class on PHPUnit 6
Fixes #20
1 parent 619c90d commit 4c34c16

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/WPPPB/Loader.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,21 @@ public function locate_wp_tests_config() {
227227
public function phpunit_compat() {
228228

229229
if ( class_exists( 'PHPUnit\Runner\Version' ) ) {
230+
230231
/**
231232
* Compatibility with PHPUnit 6+.
232233
*
233234
* @since 0.3.2
234235
*/
235236
require_once $this->get_wp_tests_dir() . '/includes/phpunit6-compat.php';
237+
238+
if ( version_compare( PHPUnit\Runner\Version::id(), '6.0', '>=' ) ) {
239+
240+
class_alias(
241+
'PHPUnit\Framework\Constraint\Constraint'
242+
, 'PHPUnit_Framework_Constraint'
243+
);
244+
}
236245
}
237246
}
238247

0 commit comments

Comments
 (0)