Completed
Push — master ( 8831d5...43d59c )
by Christian
02:21
created

ResultSpec::its_properties_can_be_read()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
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