Completed
Pull Request — master (#6)
by Christian
02:20
created

ResultSpec   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A its_properties_can_be_read() 0 11 1
A it_can_be_empty() 0 8 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\Score;
16
17
class ResultSpec extends ObjectBehavior
18
{
19
    function its_properties_can_be_read()
20
    {
21
        $score = new Score(1);
22
        $this->beConstructedWith($score, true, true, 'test', 'PT2H');
23
24
        $this->getScore()->shouldReturn($score);
25
        $this->getSuccess()->shouldReturn(true);
26
        $this->getCompletion()->shouldReturn(true);
27
        $this->getResponse()->shouldReturn('test');
28
        $this->getDuration()->shouldReturn('PT2H');
29
    }
30
31
    function it_can_be_empty()
32
    {
33
        $this->getScore()->shouldReturn(null);
34
        $this->getSuccess()->shouldReturn(null);
35
        $this->getCompletion()->shouldReturn(null);
36
        $this->getResponse()->shouldReturn(null);
37
        $this->getDuration()->shouldReturn(null);
38
    }
39
}
40