Mock magic method for ZendFramework 1.x Zend_Log
If you're mocking a ZendLog logger for your PHPUnit tests, make sure you're mocking the _call() magic method so that consumers can still use the form $log->info() etc.
public function testMockZendLog() {
$log = $this->getMock('Zend_Log');
$log->expects($this->once())
->method('__call')
->with('info', array('your message');
$log->info('your message');
}
Written by Ryan Geyer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#