MailEventTest::resultIsProperlyInjection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace AcMailerTest\Event;
5
6
use AcMailer\Event\MailEvent;
7
use AcMailer\Model\Email;
8
use AcMailer\Result\MailResult;
9
use PHPUnit\Framework\TestCase;
10
11
/**
12
 * Class MailEventTest
13
 * @author Alejandro Celaya Alastrué
14
 * @link http://www.alejandrocelaya.com
15
 */
16
class MailEventTest extends TestCase
17
{
18
    /**
19
     * @var MailEvent
20
     */
21
    private $mailEvent;
22
23
    /**
24
     * @test
25
     */
26
    public function emailIsProperlyInjected()
27
    {
28
        $email = new Email();
29
        $this->mailEvent = new MailEvent($email);
30
        $this->assertSame($email, $this->mailEvent->getEmail());
31
    }
32
33
    /**
34
     * @test
35
     */
36
    public function resultIsProperlyInjection()
37
    {
38
        $email = new Email();
39
        $this->mailEvent = new MailEvent($email);
40
        $result = new MailResult($email);
41
        $this->assertSame($this->mailEvent, $this->mailEvent->setResult($result));
42
        $this->assertSame($result, $this->mailEvent->getResult());
43
    }
44
}
45