Completed
Push — develop ( db0ed6...dcb3e3 )
by Misha
03:51 queued 01:15
created

EmailComposerTest::testReturnedMessageType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace FH\Bundle\MailerBundle\Tests\Composer;
5
6
use FH\Bundle\MailerBundle\Composer\EmailComposer;
7
use FH\Bundle\MailerBundle\Email\MessageOptions;
8
use FH\Bundle\MailerBundle\Email\Participants;
9
use PHPUnit\Framework\TestCase;
10
use Symfony\Component\Mime\Address;
11
use Symfony\Component\Mime\Email;
12
13
/**
14
 * @covers \FH\Bundle\MailerBundle\Composer\EmailComposer
15
 */
16
final class EmailComposerTest extends TestCase
17
{
18
    private $sender;
19
    private $to;
20
    private $messageOptions;
21
    private $emailComposer;
22
23
    protected function setUp(): void
24
    {
25
        $this->sender = new Address('[email protected]', 'Mr. Test');
26
        $this->to = new Address('[email protected]', 'Ms. Test');
27
28
        $this->messageOptions = new MessageOptions(
29
            'Test email',
30
            null,
31
            null,
32
            new Participants(
33
                $this->sender,
34
                [$this->sender],
35
                [$this->sender],
36
                [$this->to],
37
                [$this->to],
38
                [$this->to]
39
            )
40
        );
41
42
        $this->emailComposer = new EmailComposer($this->messageOptions);
43
    }
44
45
    public function testReturnedMessageType(): void
46
    {
47
        $email = $this->emailComposer->compose([]);
48
49
        $this->assertInstanceOf(Email::class, $email);
50
    }
51
}
52