Completed
Push — master ( 0c48af...84ef19 )
by Johannes
02:34
created

PageTest   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 4
Bugs 0 Features 4
Metric Value
wmc 9
lcom 1
cbo 2
dl 0
loc 51
rs 10
c 4
b 0
f 4
1
<?php
2
/**
3
 * Lichtenwallner  (https://lichtenwallner.at)
4
 *
5
 * @see https://github.com/jolicht/markdown-cms for the canonical source repository
6
 * @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
7
 * @copyright Copyright (c) Johannes Lichtenwallner
8
 */
9
declare(strict_types = 1);
10
namespace JolichtTest\MarkdownCms\ContentType;
11
12
use PHPUnit\Framework\TestCase;
13
use Jolicht\MarkdownCms\ContentType\Page;
14
15
class PageTest extends TestCase
16
{
17
    private $page, $created, $updated;
18
19
    protected function setUp()
20
    {
21
        $this->created = new \DateTime();
22
        $this->updated = new \DateTime();
23
        $this->page = new Page('test-id', 'TestTitle', 'testContent', $this->created, $this->updated, true, 'testTemplate');
24
    }
25
26
    public function testGetId()
27
    {
28
        $this->assertSame('test-id', $this->page->getId());
29
    }
30
31
    public function testGetTitle()
32
    {
33
        $this->assertSame('TestTitle', $this->page->getTitle());
34
    }
35
36
    public function testGetContent()
37
    {
38
        $this->assertSame('testContent', $this->page->getContent());
39
    }
40
41
    public function testGetCreated()
42
    {
43
        $this->assertSame($this->created, $this->page->getCreated());
44
    }
45
46
    public function testGetUpdated()
47
    {
48
        $this->assertSame($this->updated, $this->page->getUpdated());
49
    }
50
51
    public function testIsDraft()
52
    {
53
        $this->assertTrue($this->page->isDraft());
54
    }
55
56
    public function testGetTemplate()
57
    {
58
        $this->assertSame('testTemplate', $this->page->getTemplate());
59
    }
60
61
    public function testGetType()
62
    {
63
        $this->assertSame('page', $this->page->getType());
64
    }
65
}