Source for file Template.php

Documentation is available at Template.php

  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_Test_Model_Email_Template extends EcomDev_PHPUnit_Test_Case
  12. {
  13.     /**
  14.      *  Test getMail() function
  15.      *
  16.      *  @test
  17.      *  @doNotIndexAll
  18.      */
  19.     public function getMail()
  20.     {
  21.         // model for email/template should have been rewritten as Magentron_EmailImages_Model_Email_Template
  22.         $template Mage::getModel('core/email_template');
  23.         $this->assertEquals('Magentron_EmailImages_Model_Email_Template'get_class($template)'core/email_template model');
  24.         
  25.         // at the beginning the protected variable $_mail should be null
  26.         $variables = (array) $template;
  27.         $this->assertFalse(IsSet($variables['\x00*\x00_mail'])'variable $_mail should be null');
  28.         
  29.         // when called it should return a Magentron_EmailImages_Model_Mail object instance
  30.         $mail $template->getMail();
  31.         $this->assertEquals('Magentron_EmailImages_Model_Mail'get_class($mail)'returned mail object instance');
  32.         
  33.         // at the end the protected variable $_mail should be equal to the returned value
  34.         $variables = (array) $template;
  35.         $this->assertEquals($mail$variables["\x00*\x00_mail"]'variable $_mail should be equal to the returned mail object instance');
  36.     }
  37. }

Documentation generated on Fri, 09 Oct 2015 03:37:10 +0200 by phpDocumentor 1.4.4