public function testSendMail() { // Some cheating $_SERVER["SERVER_NAME"] = '127.0.0.1'; // Send pending mail MailQueue::sendMail(); // Ensure there are no pending emails $emails = MailQueue::model()->findAll('status=' . MailQueue::STATUS_PENDING); $this->assertTrue(count($emails) == 0); }
public function run($args) { Yii::log("Entering the method run", "info"); if (0 != $this->checkDaemonStatus()) { return 1; } // Delete old operations Operation::deleteOldOperations(); // Look for started debug info deletion operations,check their statuses // and finalize completed operations. $this->checkDebugInfoDeletionOperations(); // Delete debug info files marked for deletion $this->deletePendingDebugInfoFiles(); // Look for started debug info import operations, check their statuses // and finalize completed operations. $this->checkDebugInfoProcessingOperations(); // Import new debug info files uploaded recently. $this->processNewDebugInfoFiles(); // Look for started crash report processing operations, check their statuses // and finalize completed operations. $this->checkCrashReportProcessingOperations(); // Process new crash report files uploaded recently. $this->processNewCrashReportFiles(); // Send pending mail messages. MailQueue::sendMail(); // Perform batch import of crash report files and PDB files $importDir = Yii::app()->getBasePath() . "/import"; $batchImporter = new BatchImporter(); $importedCrashReportCount = 0; $importedDebugInfoCount = 0; $batchImporter->importFiles($importDir, $importedCrashReportCount, $importedDebugInfoCount); // Delete old temp files $this->deleteOldTempFiles(); // Success Yii::log("Leaving the method run", "info"); return 0; }