mybuilder / phpunit-accelerator

Listeners to speed up PHPUnit tests
MIT License
135 stars 12 forks source link

Declaration of TestListener::endTest() must be compatible with PHPUnit_Framework_TestListener::endTest() #15

Open umpirsky opened 6 years ago

umpirsky commented 6 years ago
phpunit::run(--no-fixtures -- --exclude-group=functional,cache,concurrency) {
    PHP Fatal error:  Declaration of MyBuilder\PhpunitAccelerator\TestListener::endTest(PHPUnit\Framework\Test $test, $time) must be compatible with PHPUnit_Framework_TestListener::endTest(PHPUnit_Framework_Test $test, $time) in src/TestListener.php on line 11

after upgrading mybuilder/phpunit-accelerator (1.2.0 => 2.0.0).

Using phpunit/phpunit:5.7.21.

peter279k commented 6 years ago

I have the same problem about this. I think it's the problem about PHPUnit because PHPUnit has been changed the namespace since they release the new stable version.

And I also found that the conditional interface_exists is not correct. I create this PR to fix this problem.

Thanks.

umpirsky commented 6 years ago

Can't remember now, but my impression at a time of this error was that phpunit-accelerator:2.0.0 does not support phpunit:5.7.21, but assumes phpunit:^7. It however allows using old version of phpunit.

peter279k commented 6 years ago

Ok. It seems that it's the PHPUnit namespace problem. Just wait for the repo of owner to review the PR :+1: .

nymo commented 4 years ago

Ping. Whats the state of the issue. I tried the library today and run into the same issue. The PR is open since 2 years now. What can we do to get this merged?

umpirsky commented 4 years ago

Double check if it brings any gains for your use case. Solution may be to just stop using it. :)

guiribmedeiros commented 4 years ago

Removing the namespace from your listener class should do the trick 🙃