I just posted a StackOverflow question about testing.
In short - the test for an abstract class goes through its code, but doesn’t mark the code as covered. Can you help get to the bottom of the problem and tell me what I’m doing wrong?
Full question with source code and details here.
For the lazy, here is the body of the question. If you can drop a hint, do so here or there, doesn’t matter (but you get more valuable upvotes there)
Writing a PHP package here, TDD with PhpUnit 4+.
Writing tests for all my regular classes works fine, and they’re covered in the report. But when I test the mock of an abstract class, even though the test clearly runs through the method (it fails if I fail to implement it, or if I put some breakpoints in there), the code coverage is 0%.
I’ve extracted the offending code into a repo here, if you’d like to give it a whirl. All you need to do is clone, composer install, and run phpunit, it’s all configured.
This is being run on a Vagrant box, so an isolated environment that has nothing in particular to do with my PHP version or available extensions, and was tested by other people, too, on their installations, producing the same results.
The abstract class being tested is here, while its test can be seen here.
Any hints on what I may be doing wrong here would be greatly appreciated.