Completed
Push — master ( c02fce...0001a8 )
by Johannes
03:23
created

AbstractActionTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 34
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 14 1
A testGetTemplateRenderer() 0 4 1
A testGetEntryParser() 0 4 1
A testGetMarkdownCmsConfig() 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\Action;
11
12
use PHPUnit\Framework\TestCase;
13
use Zend\Expressive\Template\TemplateRendererInterface;
14
use Jolicht\MarkdownCms\Action\AbstractAction;
15
use Jolicht\MarkdownCms\ContentType\EntryParser;
16
17
class AbstractActionTest extends TestCase
18
{
19
    private $action, $templateRenderer, $entryParser, $markdownCmsConfig;
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...
20
21
    protected function setUp()
22
    {
23
        $this->templateRenderer = $this->createMock(TemplateRendererInterface::class);
24
        $this->entryParser = $this->createMock(EntryParser::class);
25
        $this->markdownCmsConfig = [
26
            'options' => [
27
28
            ]
29
        ];
30
        $this->action = $this->getMockBuilder(AbstractAction::class)
31
            ->setConstructorArgs([
32
                $this->templateRenderer, $this->entryParser, $this->markdownCmsConfig
33
            ])->getMockForAbstractClass();
34
    }
35
36
    public function testGetTemplateRenderer()
37
    {
38
        $this->assertSame($this->templateRenderer, $this->action->getTemplateRenderer());
39
    }
40
41
    public function testGetEntryParser()
42
    {
43
        $this->assertSame($this->entryParser, $this->action->getEntryParser());
44
    }
45
46
    public function testGetMarkdownCmsConfig()
47
    {
48
        $this->assertSame($this->markdownCmsConfig, $this->action->getMarkdownCmsConfig());
49
    }
50
}