JsonTest::testRender()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace OpCacheGUITest\Unit\Presentation;
4
5
use OpCacheGUI\I18n\Translator;
6
use OpCacheGUI\Presentation\Json;
7
use OpCacheGUI\Presentation\Renderer;
8
use OpCacheGUI\Presentation\Template;
9
use PHPUnit\Framework\TestCase;
10
11
class JsonTest extends TestCase
12
{
13
    /**
14
     * @covers OpCacheGUI\Presentation\Json::__construct
15
     */
16
    public function testConstructCorrectInterface()
17
    {
18
        $json = new Json(__DIR__, $this->createMock(Translator::class));
19
20
        $this->assertInstanceOf(Renderer::class, $json);
21
    }
22
23
    /**
24
     * @covers OpCacheGUI\Presentation\Json::__construct
25
     */
26
    public function testConstructCorrectInstance()
27
    {
28
        $json = new Json(__DIR__, $this->createMock(Translator::class));
29
30
        $this->assertInstanceOf(Template::class, $json);
31
    }
32
33
    /**
34
     * @covers OpCacheGUI\Presentation\Json::__construct
35
     * @covers OpCacheGUI\Presentation\Json::render
36
     */
37
    public function testRender()
38
    {
39
        $json = new Json(__DIR__ . '/../../Data/templates', $this->createMock(Translator::class));
40
41
        $this->assertSame('content', $json->render('example.pjson'));
42
    }
43
}
44