@@ 43-58 (lines=16) @@ | ||
40 | $this->activityRepository = new ActivityRepository($this->objectStorage); |
|
41 | } |
|
42 | ||
43 | public function testFindActivityById() |
|
44 | { |
|
45 | $activityId = IRI::fromString('http://tincanapi.com/conformancetest/activityid'); |
|
46 | ||
47 | $this |
|
48 | ->objectStorage |
|
49 | ->expects($this->once()) |
|
50 | ->method('findObject') |
|
51 | ->with(array( |
|
52 | 'type' => 'activity', |
|
53 | 'activityId' => $activityId->getValue(), |
|
54 | )) |
|
55 | ->will($this->returnValue(MappedObject::fromModel(ActivityFixtures::getIdActivity()))); |
|
56 | ||
57 | $this->activityRepository->findActivityById($activityId); |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * @expectedException \Xabbuh\XApi\Common\Exception\NotFoundException |
|
@@ 83-98 (lines=16) @@ | ||
80 | /** |
|
81 | * @expectedException \Xabbuh\XApi\Common\Exception\NotFoundException |
|
82 | */ |
|
83 | public function testObjectIsNotAnActivity() |
|
84 | { |
|
85 | $activityId = IRI::fromString('http://tincanapi.com/conformancetest/activityid'); |
|
86 | ||
87 | $this |
|
88 | ->objectStorage |
|
89 | ->expects($this->once()) |
|
90 | ->method('findObject') |
|
91 | ->with(array( |
|
92 | 'type' => 'activity', |
|
93 | 'activityId' => $activityId->getValue(), |
|
94 | )) |
|
95 | ->will($this->returnValue(MappedObject::fromModel(ActorFixtures::getMboxAgent()))); |
|
96 | ||
97 | $this->activityRepository->findActivityById($activityId); |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * @return \PHPUnit_Framework_MockObject_MockObject|ObjectStorage |