GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

VndErrorRepresentationTest::testSerialize()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 44
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 44
c 1
b 0
f 0
rs 8.8571
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
namespace Hateoas\Tests\Representation;
4
5
use Hateoas\Configuration\Relation;
6
use Hateoas\Representation\VndErrorRepresentation;
7
8
class VndErrorRepresentationTest extends RepresentationTestCase
9
{
10
    public function testSerialize()
11
    {
12
        $error = new VndErrorRepresentation(
13
            'Validation failed',
14
            42,
15
            new Relation('help', 'http://.../', null, array('title' => 'Error Information')),
16
            new Relation('describes', 'http://.../', null, array('title' => 'Error Description'))
17
        );
18
19
        $this->assertSame(
20
            <<<XML
21
<?xml version="1.0" encoding="UTF-8"?>
22
<resource logref="42">
23
  <message><![CDATA[Validation failed]]></message>
24
  <link rel="help" href="http://.../" title="Error Information"/>
25
  <link rel="describes" href="http://.../" title="Error Description"/>
26
</resource>
27
28
XML
29
            ,
30
            $this->hateoas->serialize($error, 'xml')
31
        );
32
33
        $this->assertSame(
34
            <<<JSON
35
{
36
    "message": "Validation failed",
37
    "logref": 42,
38
    "_links": {
39
        "help": {
40
            "href": "http:\/\/...\/",
41
            "title": "Error Information"
42
        },
43
        "describes": {
44
            "href": "http:\/\/...\/",
45
            "title": "Error Description"
46
        }
47
    }
48
}
49
JSON
50
            ,
51
            $this->json($this->halHateoas->serialize($error, 'json'))
52
        );
53
    }
54
}
55