Completed
Pull Request — master (#7)
by Christian
02:25
created

DefinitionSpec::its_properties_can_be_read()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 20
rs 9.4285
cc 1
eloc 14
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 DefinitionSpec extends ObjectBehavior
17
{
18
    function its_properties_can_be_read()
19
    {
20
        $this->beConstructedWith(
21
            array('en-US' => 'test'),
22
            array('en-US' => 'test'),
23
            'http://id.tincanapi.com/activitytype/unit-test'
24
        );
25
26
        $name = $this->getName();
27
        $name->shouldBeArray();
28
        $name->shouldHaveCount(1);
29
        $name->shouldHaveKeyWithValue('en-US', 'test');
30
31
        $description = $this->getName();
32
        $description->shouldBeArray();
33
        $description->shouldHaveCount(1);
34
        $description->shouldHaveKeyWithValue('en-US', 'test');
35
36
        $this->getType()->shouldReturn('http://id.tincanapi.com/activitytype/unit-test');
37
    }
38
39
    function it_can_be_empty()
40
    {
41
        $this->getName()->shouldReturn(null);
42
        $this->getDescription()->shouldReturn(null);
43
        $this->getType()->shouldReturn(null);
44
    }
45
}
46