Passed
Push — master ( 4f415b...b6b0b7 )
by Gabriel
03:01
created

HasFormatTraitTest::test_getFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Nip\Controllers\Tests\Response\ResponsePayload;
4
5
use Nip\Controllers\Response\ResponsePayload;
6
use Nip\Controllers\Tests\AbstractTest;
7
8
/**
9
 * Class HasFormatTraitTest
10
 * @package Nip\Controllers\Tests\Response\ResponsePayload
11
 */
12
class HasFormatTraitTest extends AbstractTest
13
{
14
    public function test_getFormat()
15
    {
16
        $payload = new ResponsePayload();
17
18
        self::assertSame(null, $payload->getFormat());
19
    }
20
21
    public function test_getFormat_withDefaultFormat()
22
    {
23
        $payload = new ResponsePayload();
24
        $payload->withDefaultFormat('html');
25
26
        self::assertSame('html', $payload->getFormat());
27
    }
28
}
29