Completed
Push — master ( 3b5087...2fd7fd )
by Johannes
02:01
created

PageTest::testGetUpdated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 0
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;
0 ignored issues
show
Coding Style introduced by
It is generally advisable to only define one property per statement.

Only declaring a single property per statement allows you to later on add doc comments more easily.

It is also recommended by PSR2, so it is a common style that many people expect.

Loading history...
18
19
    protected function setUp()
20
    {
21
        $this->created = new \DateTime();
22
        $this->updated = new \DateTime();
23
        $this->page = new Page('test-id', 'TestTitle', $this->created, $this->updated, true);
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 testGetCreated()
37
    {
38
        $this->assertSame($this->created, $this->page->getCreated());
39
    }
40
41
    public function testGetUpdated()
42
    {
43
        $this->assertSame($this->updated, $this->page->getUpdated());
44
    }
45
46
    public function testIsDraft()
47
    {
48
        $this->assertTrue($this->page->isDraft());
49
    }
50
}