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.
Completed
Push — master ( 1978d2...e2f699 )
by William
03:55
created

RelationTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testConstructor() 0 8 1
A requireHrefOrEmbed() 0 10 1
A canBeConstructedWithOnlyAnEmbed() 0 10 1
1
<?php
2
3
namespace Hateoas\Tests\Configuration;
4
5
use Hateoas\Tests\TestCase;
6
use Hateoas\Configuration\Relation;
7
8
class RelationTest extends TestCase
9
{
10
    public function testConstructor()
11
    {
12
        $relation = new Relation('self', 'user_get');
13
14
        $this->assertSame('self', $relation->getName());
15
        $this->assertSame('user_get', $relation->getHref());
16
        $this->assertEmpty($relation->getAttributes());
17
    }
18
19
    public function requireHrefOrEmbed()
20
    {
21
        $this
0 ignored issues
show
Bug introduced by
The method exception() does not exist on Hateoas\Tests\Configuration\RelationTest. Did you maybe mean getExpectedException()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
22
            ->exception(function () {
23
                new Relation('', null, null);
24
            })
25
            ->isInstanceOf('InvalidArgumentException')
26
            ->hasMessage('$href and $embedded cannot be both null.')
27
        ;
28
    }
29
30
    public function canBeConstructedWithOnlyAnEmbed()
31
    {
32
        $relation = new Relation('self', null, 'foo');
33
34
        $this->assertSame('self', $relation->getName());
35
        $this->assertNull($relation->getHref());
36
        $this->assertEmpty($relation->getAttributes());
37
        $this->assertInstanceOf('Hateoas\Configuration\Embed', $relation->getEmbedded());
38
        $this->assertSame('foo', $relation->getEmbedded()->getContent());
39
    }
40
}
41