Home » Testing » PHPUnit2 » Bug #7887
Mocking interfaces
Details
| Request #7887 | Mocking interfaces |
|---|---|
| Submitted | 2006-06-13 15:13 UTC |
| From | Jared dot Williams1 at ntlworld dot com |
| Status | Closed |
| Package | PHPUnit2 |
| PHP Version | Irrelevant |
| OS | Win2000 |
| Roadmaps | (Not assigned) |
Comments
[2006-06-13 15:13 UTC] Jared dot Williams1 at ntlworld dot com
Description:
------------
When generating a mock based on an interface, all methods of the interface should be mocked.
Fatal error: Class Mock_ContentStore_f248c6fb contains 1 abstract method and must therefore be declared abstract or implement the remaining method
s (ContentStore::open) in \PEAR\PHPUnit2\Extensions\MockObject\Mock.php(145) : eval()'d code on line 28
I would think this could make testing more less brittle as adding a method to an interface wouldn't break all existing tests using it.
[2006-06-29 12:26 UTC] maxx dot gass at googlemail dot com
Mocking interfaces is already possible in CVS.
[2006-06-29 12:27 UTC] sebastian at php dot net
Closing per previous comment.