MailEventTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 29
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A emailIsProperlyInjected() 0 6 1
A resultIsProperlyInjection() 0 8 1
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