resource = new Zend_Application_Resource_Zendmonitor(); } public function testGetLogLazyLoadsLog() { $log = $this->resource->getLog(); $this->assertTrue($log instanceof Zend_Log); } public function testInitReturnsLogInstance() { $log = $this->resource->init(); $this->assertTrue($log instanceof Zend_Log); } public function testInitReturnsSameLogInstanceAsGetter() { $log = $this->resource->getLog(); $this->assertSame($log, $this->resource->init()); } public function testSetterWillOverwriteExistingLogInstance() { $existing = $this->resource->getLog(); $this->resource->setLog($log = new Zend_Log(new Zend_Log_Writer_Mock())); $this->assertNotSame($existing, $this->resource->getLog()); $this->assertSame($log, $this->resource->getLog()); } }