1 | <?php |
||
18 | class DefinitionSpec extends ObjectBehavior |
||
19 | { |
||
20 | function its_properties_can_be_read() |
||
21 | { |
||
22 | $name = LanguageMap::create(array('en-US' => 'test')); |
||
23 | $description = LanguageMap::create(array('en-US' => 'test')); |
||
24 | $this->beConstructedWith( |
||
25 | $name, |
||
26 | $description, |
||
27 | 'http://id.tincanapi.com/activitytype/unit-test', |
||
28 | 'https://github.com/adlnet/xAPI_LRS_Test' |
||
29 | ); |
||
30 | |||
31 | $this->getName()->shouldReturn($name); |
||
32 | $this->getDescription()->shouldReturn($description); |
||
33 | $this->getType()->shouldReturn('http://id.tincanapi.com/activitytype/unit-test'); |
||
34 | $this->getMoreInfo()->shouldReturn('https://github.com/adlnet/xAPI_LRS_Test'); |
||
35 | } |
||
36 | |||
37 | function it_can_be_empty() |
||
38 | { |
||
39 | $this->getName()->shouldReturn(null); |
||
40 | $this->getDescription()->shouldReturn(null); |
||
41 | $this->getType()->shouldReturn(null); |
||
42 | $this->getMoreInfo()->shouldReturn(null); |
||
43 | |||
44 | $this->equals(new Definition())->shouldReturn(true); |
||
45 | } |
||
46 | |||
47 | function it_is_different_when_names_are_omitted_and_other_definition_contains_an_empty_list_of_names() |
||
48 | { |
||
49 | $this->equals(new Definition(new LanguageMap()))->shouldReturn(false); |
||
50 | } |
||
51 | |||
52 | function it_is_different_when_descriptions_are_omitted_and_other_definition_contains_an_empty_list_of_descriptions() |
||
53 | { |
||
54 | $this->equals(new Definition(null, new LanguageMap()))->shouldReturn(false); |
||
55 | } |
||
56 | } |
||
57 |