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

HasFormatTraitTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
dl 0
loc 15
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_getFormat_withDefaultFormat() 0 6 1
A test_getFormat() 0 5 1
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