Completed
Push — master ( ed99ce...fdbe36 )
by Christian
07:57 queued 05:37
created

AgentSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_an_actor() 0 6 1
A its_properties_can_be_read() 0 8 1
A it_is_not_equal_to_a_group() 0 6 1
A it_is_not_equal_to_an_activity() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the xAPI package.
5
 *
6
 * (c) Christian Flothmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace spec\Xabbuh\XApi\Model;
13
14
use PhpSpec\ObjectBehavior;
15
use Xabbuh\XApi\Model\Activity;
16
use Xabbuh\XApi\Model\Group;
17
use Xabbuh\XApi\Model\InverseFunctionalIdentifier;
18
19
class AgentSpec extends ObjectBehavior
20
{
21
    function it_is_an_actor()
22
    {
23
        $iri = InverseFunctionalIdentifier::withMbox('mailto:[email protected]');
24
        $this->beConstructedWith($iri);
25
        $this->shouldHaveType('Xabbuh\XApi\Model\Actor');
26
    }
27
28
    function its_properties_can_be_read()
29
    {
30
        $iri = InverseFunctionalIdentifier::withMbox('mailto:[email protected]');
31
        $this->beConstructedWith($iri, 'test');
32
33
        $this->getInverseFunctionalIdentifier()->shouldReturn($iri);
34
        $this->getName()->shouldReturn('test');
35
    }
36
37
    function it_is_not_equal_to_a_group()
38
    {
39
        $this->beConstructedWith(InverseFunctionalIdentifier::withMbox('mailto:[email protected]'));
40
41
        $this->equals(new Group(InverseFunctionalIdentifier::withMbox('mailto:[email protected]')))->shouldReturn(false);
42
    }
43
44
    function it_is_not_equal_to_an_activity()
45
    {
46
        $this->beConstructedWith(InverseFunctionalIdentifier::withMbox('mailto:[email protected]'));
47
48
        $this->equals(new Activity())->shouldReturn(false);
49
    }
50
}
51