Passed
Push — master ( 09a839...6515e3 )
by Tomasz
02:07
created

DomainTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 22
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testInitialize() 0 4 1
A testGetDomainId() 0 5 1
A testEvents() 0 7 1
1
<?php
2
/**
3
 * Copyright
4
 */
5
namespace Hexarchium\CoreDomain\Tests\Model\Domain\Entity;
6
7
use Hexarchium\CoreDomain\Events\DomainEventInterface;
8
use Hexarchium\CoreDomain\Model\Domain\DomainId;
9
use Hexarchium\CoreDomain\Model\Domain\Entity\Domain;
10
11
class DomainTest extends \PHPUnit_Framework_TestCase
12
{
13
14
    public function testInitialize()
15
    {
16
        $this->assertInstanceOf(Domain::class, new Domain(new DomainId('1')));
17
    }
18
19
    public function testGetDomainId()
20
    {
21
        $domain = new Domain(new DomainId('test'));
22
        $this->assertEquals('test', $domain->getId()->getId());
23
    }
24
25
    public function testEvents()
26
    {
27
        $domain = new Domain(new DomainId('test'));
28
        $domainEvents = $domain->pullEvents();
29
        $this->assertCount(1, $domainEvents);
30
        $this->assertContainsOnlyInstancesOf(DomainEventInterface::class, $domainEvents);
31
    }
32
}
33