-
Notifications
You must be signed in to change notification settings - Fork 156
[HHVM] Cannot mock abstract classes which don't fully implement an interface #223
Comments
Oops, that's the wrong error message. One moment, let me fix that. |
Error message has been corrected:
You can see a real-world instance of this occurring in my project's Travis build:
|
Yeah, this looks like an HHVM issue. You could either wait until it's fixed or (temporarily) revert that change. |
+1 |
@colinodell Not knowing the innards of PHPUnit, I'm unclear why this is an HHVM issue. Is Mock_AbstractTestClass_727654a9 declaring a bar method? If not then it has to be abstract.. that's working-as-intended as far as I can see from here... |
Nevermind, looks like @fredemmott already looked into it and it's been fixed in the 3.8 branch. |
It looks like this was fixed in hhvm by this: facebook/hhvm@b786320 I haven't verified this yet. |
@sgolemon HHVM contained a bug in their |
HHVM < 3.8 has a bug in its Reflection API that breaks the behavior of `getMockForAbstractClass()` ([see phpunit-mock-objects #223](sebastianbergmann/phpunit-mock-objects#223)).
- Skip a test in HHVM < 3.8. HHVM < 3.8 has a bug in its Reflection API that breaks the behavior of `getMockForAbstractClass()` ([see phpunit-mock-objects #223](sebastianbergmann/phpunit-mock-objects#223)). - Use a valid PDO connection option when testing passing connection options to PDO.
I'm experiencing an issue which seems to be caused by commit c684a8a and/or HHVM. I'm essentially unable to mock an abstract class which doesn't fully implement an interface.
You can replicate the issue by defining an interface with two methods:
And then create an abstract instance which only implements one of the methods:
Running a test like this fails:
This behavior only occurs when using 2.3.1 on HHVM (I'm using 3.6.1). 2.3.0 works just fine because it doesn't contain commit d4cc5f0b. Also, this behavior does not seem to occur in PHP on 2.3.1.
The text was updated successfully, but these errors were encountered: