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

AbstractContentTypeTest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 2
dl 0
loc 50
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 10 1
A testGetId() 0 4 1
A testGetTitle() 0 4 1
A testGetContent() 0 4 1
A testGetCreated() 0 4 1
A testGetUpdated() 0 4 1
A testIsDraft() 0 4 1
A testGetTemplate() 0 4 1
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
}