Completed
Pull Request — master (#3)
by Christian
03:16
created

GroupSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 25
ccs 0
cts 19
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_can_be_initialized_without_an_inverse_functional_identifier() 0 5 1
A it_is_an_actor() 0 5 1
A its_properties_can_be_read() 0 10 1
1
<?php
2
3
namespace spec\Xabbuh\XApi\Model;
4
5
use PhpSpec\ObjectBehavior;
6
use Xabbuh\XApi\Model\Agent;
7
use Xabbuh\XApi\Model\InverseFunctionalIdentifier;
8
9
class GroupSpec extends ObjectBehavior
10
{
11
    function it_can_be_initialized_without_an_inverse_functional_identifier()
12
    {
13
        $this->beConstructedWith(null, 'anonymous group');
14
        $this->shouldBeAnInstanceOf('Xabbuh\XApi\Model\Group');
15
    }
16
17
    function it_is_an_actor()
18
    {
19
        $this->beConstructedWith(null, 'test');
20
        $this->shouldHaveType('Xabbuh\XApi\Model\Actor');
21
    }
22
23
    function its_properties_can_be_read()
24
    {
25
        $iri = InverseFunctionalIdentifier::withMbox('mailto:[email protected]');
26
        $members = array(new Agent(InverseFunctionalIdentifier::withMbox('mailto:[email protected]')));
27
        $this->beConstructedWith($iri, 'test', $members);
28
29
        $this->getInverseFunctionalIdentifier()->shouldReturn($iri);
30
        $this->getName()->shouldReturn('test');
31
        $this->getMembers()->shouldReturn($members);
32
    }
33
}
34