AcMailerTest\Service\MailServiceAbstractFactoryTest::testTemplateBody PHP Method

testTemplateBody() public method

public testTemplateBody ( )
    public function testTemplateBody()
    {
        $options = ['message_options' => ['body' => ['content' => 'This body is not going to be used', 'use_template' => true, 'template' => ['path' => 'ac-mailer/mail-templates/layout', 'children' => ['content' => ['path' => 'ac-mailer/mail-templates/mail']]]]]];
        $this->initServiceLocator($options);
        $resolver = new TemplatePathStack();
        $resolver->addPath(__DIR__ . '/../../view');
        $renderer = new PhpRenderer();
        $renderer->setResolver($resolver);
        $this->serviceLocator->set('mailviewrenderer', $renderer);
        $mailService = $this->mailServiceFactory->__invoke($this->serviceLocator, 'acmailer.mailservice.default');
        $this->assertNotEquals($options['message_options']['body']['content'], $mailService->getMessage()->getBody());
        $this->assertInstanceOf('Zend\\Mime\\Message', $mailService->getMessage()->getBody());
    }