Test Failed
Push — master ( c81326...794fe0 )
by Johannes
03:04
created

AbstractContentTypeTest::testGetTemplate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
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\AbstractContentType;
14
15
class AbstractContentTypeTest extends TestCase
16
{
17
    private $contentType, $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
24
        $this->contentType = $this->getMockBuilder(AbstractContentType::class)
25
            ->setConstructorArgs([
26
                'testId', 'TestTitle', 'testContent', $this->created, $this->updated, true, 'testTemplate'
27
            ])->getMockForAbstractClass();
28
    }
29
30
    public function testGetId()
31
    {
32
        $this->assertSame('testId', $this->contentType->getId());
33
    }
34
35
    public function testGetTitle()
36
    {
37
        $this->assertSame('TestTitle', $this->contentType->getTitle());
38
    }
39
40
    public function testGetContent()
41
    {
42
        $this->assertSame('testContent', $this->contentType->getContent());
43
    }
44
45
    public function testGetCreated()
46
    {
47
        $this->assertSame($this->created, $this->contentType->getCreated());
48
    }
49
50
    public function testGetUpdated()
51
    {
52
        $this->assertSame($this->updated, $this->contentType->getUpdated());
53
    }
54
55
    public function testIsDraft()
56
    {
57
        $this->assertTrue($this->contentType->isDraft());
58
    }
59
60
    public function testGetTemplate()
61
    {
62
        $this->assertSame('testTemplate', $this->contentType->getTemplate());
63
    }
64
}