1. Jorge Vazquez
  2. Apmgr

Commits

jvazquez  committed e020712

Fixed the Email_Context object

  • Participants
  • Parent commits 1a38415
  • Branches default

Comments (0)

Files changed (3)

File .hgignore

View file
 ^utils/eclipse/Skeleton-unitmetadata\.launch$
 
 syntax: regexp
-^tests/fakemails/email\.eml$
+^tests/fakemails/.+\.eml$
 ^tests/logs/*.log$
 ^cache/zend_cache*?
 ^logs/.+\.log
 ^public/uploads/.+\.[png|gif|jpg]
-heads.log
+heads.log

File tests/application/bootstrap.php

View file
 
 defined('APPLICATION_UPLOADS') || define('APPLICATION_UPLOADS',realpath(dirname(APPLICATION_PATH.'/../../')));
 
+//Used for dummy emails
+defined('APPLICATION_FAKEMAILS') || define('APPLICATION_FAKEMAILS', realpath( dirname(__FILE__ ).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'fakemails' ) );
+
 // Ensure library/ is on include_path
 set_include_path( implode (PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/../../library'),realpath(APPLICATION_PATH . '/modules'),get_include_path() ) ) );
-//TODO Change this to your tz
-date_default_timezone_set("America/Buenos_Aires");
+
+date_default_timezone_set("America/Chicago");
 setlocale(LC_ALL,'en_US');
 
 require_once 'Zend/Loader/Autoloader.php';

File tests/application/library/Email/Email_ContextTest.php

View file
     
     public function testDeliverEmail()
     {
-    	$communicator = new ZFEmail_Html();
-    	$context = new ZFEmail_Context();
-    	$context->setCommunicator($communicator);
+    	$mail = new ZFEmail_Html();
+    	$context = new ZFEmail_Context(APPLICATION_FAKEMAILS.DIRECTORY_SEPARATOR.'testmail.eml');
     	$args = array('nameFrom'=>'Jorge Vazquez','from'=>'jorgeomar.vazquez@gmail.com','nameTo'=>'Ck LOL','to'=>'bigheadmutant@lolsmart.com','subject'=>'lol wing your code','body'=>'~@andiheartheloltrain@~');
-    	$this->assertType('ZFInterfaces_Deliverable',$context->deliverEmail($args));
+    	$result = $context->send($mail->build($args));
     }
 }
 ?>