true, 'level' => Logger::$ERROR, 'type' => 'stream', 'target' => $target ) ) ); $this->assertFileExists($target, 'Logger did not create the log file'); unlink($target); } /** * @depends testLogfileCreation */ public function testLoggingErrorMessages() { $target = tempnam(sys_get_temp_dir(), 'log'); unlink($target); $logger = new Logger( new Zend_Config( array( 'enable' => true, 'level' => Logger::$ERROR, 'type' => 'stream', 'target' => $target ) ) ); $logger->log('This is a test error', Logger::$ERROR); $log = file_get_contents($target); unlink($target); $this->assertContains('This is a test error', $log, 'Log does not contain the error "This is a test error"'); } }