public function testLoggingDisabled() { $config = Zend_Registry::get('Zend_Config'); $logUntranslated = $config->log->untranslated; $config->log->untranslated = false; $logger = new MockLogger(); $translate = new Application_Translate(array('log' => $logger)); $translate->loadModule('admin'); $this->assertFalse($translate->isTranslated('nottranslated123')); $this->assertEquals('nottranslated123', $translate->translate('nottranslated123')); $messages = $logger->getMessages(); $this->assertEquals(0, count($messages)); $config->log->untranslated = $logUntranslated; }
public function testLoggerIsInvokedIfSetActive() { $conn = new FullMockConnection(); $conn->setReturnValueAt(0, "read", "220 xxx ESMTP"); $conn->setReturnValueAt(1, "read", "250-Hello xxx\r\n250 HELP"); $conn->setReturnValueAt(2, "read", "250 Ok"); $conn->setReturnValueAt(3, "read", "250 ok"); $conn->setReturnValueAt(4, "read", "354 Go ahead"); $conn->setReturnValueAt(5, "read", "250 ok"); $logger = new MockLogger(); $logger->setLogLevel(Swift_Log::LOG_EVERYTHING); $logger->expectMinimumCallCount("add", 8); Swift_LogContainer::setLog($logger); $swift = new Swift($conn, "abc"); $message = new Swift_Message("My Subject", "my body"); $swift->send($message, new Swift_Address("*****@*****.**"), new Swift_Address("*****@*****.**", "Foo Bar")); }