Completed
Pull Request — master (#9)
by Christian
02:12
created

its_display_property_is_null_if_omitted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
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
16
class VerbSpec extends ObjectBehavior
17
{
18
    function it_detects_voiding_verbs()
19
    {
20
        $this->beConstructedWith('http://adlnet.gov/expapi/verbs/voided');
21
        $this->isVoidVerb()->shouldReturn(true);
22
    }
23
24
    function its_properties_can_be_read()
25
    {
26
        $this->beConstructedWith('http://tincanapi.com/conformancetest/verbid', array('en-US' => 'test'));
27
28
        $this->getId()->shouldReturn('http://tincanapi.com/conformancetest/verbid');
29
        $this->getDisplay()->shouldReturn(array('en-US' => 'test'));
30
    }
31
32
    function its_display_property_is_null_if_omitted()
33
    {
34
        $this->beConstructedWith('http://tincanapi.com/conformancetest/verbid');
35
36
        $this->getId()->shouldReturn('http://tincanapi.com/conformancetest/verbid');
37
        $this->getDisplay()->shouldReturn(null);
38
    }
39
40
    function it_creates_voiding_verb_through_factory_method()
41
    {
42
        $this->beConstructedThrough(array('Xabbuh\XApi\Model\Verb', 'createVoidVerb'));
43
44
        $this->shouldHaveType('Xabbuh\XApi\Model\Verb');
45
        $this->getId()->shouldReturn('http://adlnet.gov/expapi/verbs/voided');
46
    }
47
}
48