Ejemplo n.º 1
0
 /**
  * Testing EmailTemplate::parse_tracker_urls
  * @group 46984
  * @dataProvider templatesProvider
  */
 public function testParseTrackerUrl($data, $expects, $result)
 {
     $et = new EmailTemplate();
     $res = $et->parse_tracker_urls($data[0], $data[1], $data[2], $data[3]);
     if ($result) {
         $this->assertEquals($expects, $res);
     } else {
         $this->assertNotEquals($expects, $res);
     }
 }
Ejemplo n.º 2
0
 public function testparse_email_templateAndParse_tracker_urls()
 {
     $emailTemplate = new EmailTemplate();
     //test parse_email_template
     $account = new Account();
     $macro_nv = array();
     $expected = array('subject' => 'test subject', 'body_html' => 'test html', 'body' => 'test body text');
     $actual = $emailTemplate->parse_email_template(array('subject' => 'test subject', 'body_html' => 'test html', 'body' => 'test body text'), 'Accounts', $account, $macro_nv);
     $this->assertSame($expected, $actual);
     //test Parse_tracker_urls
     $tracker_url_template = 'localhost/index.php?entryPoint=campaign_trackerv2&track=%s&identifier=tracker_key';
     $removeme_url_template = 'localhost/index.php?entryPoint=removeme&identifier=tracker_key';
     $tracker_urls = array();
     $result = $emailTemplate->parse_tracker_urls($actual, $tracker_url_template, $tracker_urls, $removeme_url_template);
     $this->assertSame($expected, $result);
 }