Removed ely/email-renderer package and implemented new emails renderer client [skip ci]

This commit is contained in:
ErickSkrauch
2019-06-07 02:16:13 +03:00
parent 7b14b92a10
commit 1bf249030f
23 changed files with 262 additions and 146 deletions

View File

@@ -1,7 +1,7 @@
<?php
namespace common\tests\unit\emails;
use common\components\EmailRenderer;
use common\components\EmailsRenderer\Component;
use common\emails\TemplateWithRenderer;
use common\tests\_support\ProtectedCaller;
use common\tests\unit\TestCase;
@@ -18,7 +18,7 @@ class TemplateWithRendererTest extends TestCase {
$this->assertSame('mock-to', $template->getTo());
$this->assertSame('mock-locale', $template->getLocale());
$this->assertInstanceOf(MailerInterface::class, $template->getMailer());
$this->assertInstanceOf(EmailRenderer::class, $template->getEmailRenderer());
$this->assertInstanceOf(Component::class, $template->getRenderer());
}
public function testCreateMessage() {
@@ -26,8 +26,8 @@ class TemplateWithRendererTest extends TestCase {
$templateBuilder = mock(TemplateBuilder::class)->makePartial();
$templateBuilder->shouldReceive('render')->andReturn('mock-html');
/** @var EmailRenderer|\Mockery\MockInterface $renderer */
$renderer = mock(EmailRenderer::class)->makePartial();
/** @var Component|\Mockery\MockInterface $renderer */
$renderer = mock(Component::class)->makePartial();
$renderer->shouldReceive('getTemplate')->with('mock-template')->andReturn($templateBuilder);
/** @var TemplateWithRenderer|\Mockery\MockInterface $template */