Completed
Push — master ( 1da4a7...53bb89 )
by Alex
02:34
created

PayloadRenderTraitTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testPayload() 0 4 1
A testPayloadRender() 0 10 1
1
<?php
2
3
namespace Asmaster\EquipTwig\Tests\Traits;
4
5
use PHPUnit_Framework_TestCase as TestCase;
6
use Equip\Adr\PayloadInterface;
7
use Asmaster\EquipTwig\Traits\PayloadRenderTrait;
8
9
class PayloadRenderTraitTest extends TestCase
10
{
11
    use PayloadRenderTrait;
12
13
    public function testPayload()
14
    {
15
        $this->assertInstanceOf(PayloadInterface::class, $this->payload());
16
    }
17
18
    public function testPayloadRender()
19
    {
20
        $output = [
21
            'template' => 'index.html.twig',
22
            ['body' => 'body']
23
        ];
24
25
        $payload = $this->render($output['template'], $output);
26
        $this->assertEquals($output, $payload->getOutput());
27
    }
28
}
29