Current file: htdocs/.modman/magentron_emailimages/Magentron/EmailImages/Model/Email.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
100.00%100.00%
100.00% 1 / 1
100.00%100.00%
100.00% 1 / 1 CRAP
100.00%100.00%
100.00% 13 / 13
 
Magentron_EmailImages_Model_Email
100.00%100.00%
100.00% 1 / 1
100.00%100.00%
100.00% 1 / 1
100.00%100.00%
100.00% 13 / 13
 send()
100.00%100.00%
100.00% 1 / 1 3
100.00%100.00%
100.00% 12 / 12


       1                 : <?php                                                                                        
       2                 : /**                                                                                          
       3                 :  *    Magentron EmailImages Extension                                                        
       4                 :  *                                                                                           
       5                 :  *    @category    Magentron                                                                 
       6                 :  *    @package    Magentron_EmailImages                                                      
       7                 :  *    @author        Jeroen Derks                                                            
       8                 :  *    @copyright    Copyright (c) 2011 Jeroen Derks http://www.magentron.com                 
       9                 :  *    @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
      10                 :  */                                                                                          
      11                 : class Magentron_EmailImages_Model_Email extends Mage_Core_Model_Email                        
      12               1 : {                                                                                            
      13                 :     public function send()                                                                   
      14                 :     {                                                                                        
      15               2 :         if (Mage::getStoreConfigFlag('system/smtp/disable')) {                               
      16               1 :             return $this;                                                                    
      17                 :         }                                                                                    
      18                 :                                                                                              
      19                 :         /** @TODO check if it would be safe to set template as context on mail instance */   
      20                 :         /** @var    $mail    Magentron_EmailImages_Model_Mail */                             
      21               1 :         $mail = Mage::getModel('emailimages/mail');                                          
      22                 :                                                                                              
      23               1 :         if (strtolower($this->getType()) == 'html') {                                        
      24               1 :             $mail->setBodyHtml($this->getBody());                                            
      25               1 :         }                                                                                    
      26                 :         else {                                                                               
      27               1 :             $mail->setBodyText($this->getBody());                                            
      28                 :         }                                                                                    
      29                 :                                                                                              
      30               1 :         $mail->setFrom($this->getFromEmail(), $this->getFromName())                          
      31               1 :             ->addTo($this->getToEmail(), $this->getToName())                                 
      32               1 :             ->setSubject($this->getSubject());                                               
      33               1 :         $mail->send();                                                                       
      34                 :                                                                                              
      35               1 :         return $this;                                                                        
      36                 :     }                                                                                        

Generated by PHP_CodeCoverage 1.0.4 using PHP 5.3.4 and PHPUnit 3.5.13 at Tue Jul 5 9:07:16 UTC 2011.