YamlSerializerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 20
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testContentType() 0 3 1
A testSerialize() 0 3 1
1
<?php
2
3
namespace Ntb\RestAPI;
4
5
use SapphireTest;
6
7
/**
8
 * Tests for the yaml serializer.
9
 * @author Christian Blank <[email protected]>
10
 */
11
class YamlSerializerTest extends SapphireTest {
12
13
    /**
14
     * @var YamlSerializer
15
     */
16
    private $serializer;
17
18
    public function setUp() {
19
        parent::setUp();
20
        $this->serializer = new YamlSerializer();
21
    }
22
23
    public function testContentType() {
24
        $this->assertEquals('application/yaml', $this->serializer->contentType());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<Ntb\RestAPI\YamlSerializerTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
25
    }
26
27
    public function testSerialize() {
28
        $this->assertTrue(is_string($this->serializer->serialize(['data' => ['a' => 1, 'b' => 2]])));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<Ntb\RestAPI\YamlSerializerTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
29
    }
30
}
31