Archive for July, 2010

Mocking Objects with Final Methods in PHPUnit

Wednesday, July 7th, 2010

Having some issues with a mock in PHPUnit - the method on the mocked object was being called and the code run (bootstrap method on Zend_Application_Bootstrap_BootstrapAbstract). After some head scratching, I realized it was a final method, so PHPUnit can’t override it, and thus, the code is executed. I extended Zend_Application_Bootstrap_BootstrapAbstract and overwrote the […]