public function testWithDefaultLayout() { $resolver = new TemplatePathStack(); $resolver->addPath(__DIR__ . '/../../view'); $this->mailService->getRenderer()->setResolver($resolver); $model = new ViewModel(); $model->setTemplate('ac-mailer/mail-templates/layout.phtml'); $this->mailService->setDefaultLayout(new DefaultLayout($model)); $this->mailService->setTemplate('ac-mailer/mail-templates/mail.phtml'); $this->assertInstanceOf('Zend\\Mime\\Message', $this->mailService->getMessage()->getBody()); }
public function testStringBypassedBodyIsWrappedIntoMimePartWithAttachments() { $cwd = getcwd(); chdir(dirname(__DIR__)); $this->mailService->setAttachments(array('attachments/file1', 'attachments/file2')); $this->mailService->getMessage()->setBody('Btpassed body as string'); $result = $this->mailService->send(); $this->assertTrue($result->isValid()); /* @var Mime\Message $body */ $body = $this->mailService->getMessage()->getBody(); $this->assertInstanceOf('Zend\\Mime\\Message', $body); chdir($cwd); }