php-vcr/phpunit-testlistener-vcr

PHPUnit 6 support?

GaryJones opened this issue · 2 comments

Are there plans to support PHPUnit 6? The PHPUnit code is now namespaced.

In the mean time, aliasing the classes in my test bootstrap.php works:

$phpunitAliases = [
    '\PHPUnit\Framework\Test' => '\PHPUnit_Framework_Test',
    '\PHPUnit\Framework\TestListener' => '\PHPUnit_Framework_TestListener',
    '\PHPUnit\Framework\Warning' => '\PHPUnit_Framework_Warning',
    '\PHPUnit\Framework\AssertionFailedError' => '\PHPUnit_Framework_AssertionFailedError',
    '\PHPUnit\Framework\TestSuite' => '\PHPUnit_Framework_TestSuite',
];

foreach ($phpunitAliases as $namespaced => $alias) {
    if (!class_exists($alias)) {
        class_alias($namespaced, $alias);
    }
}

The problem with aliasing is that if other packages you have installed require PHPUnit 6, installation will fail because of conflicting requirements 🙁