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

DomainTest::testEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
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