@@ 102-124 (lines=23) @@ | ||
99 | ); |
|
100 | } |
|
101 | ||
102 | public function testGetDocument() |
|
103 | { |
|
104 | $document = DocumentFixtures::getAgentProfileDocument(); |
|
105 | $profile = $document->getAgentProfile(); |
|
106 | ||
107 | $this->validateRetrieveApiCall( |
|
108 | 'get', |
|
109 | 'agents/profile', |
|
110 | array( |
|
111 | 'agent' => 'agent-as-json', |
|
112 | 'profileId' => 'profile-id', |
|
113 | ), |
|
114 | 200, |
|
115 | 'DocumentData', |
|
116 | $document->getData(), |
|
117 | array(array('data' => $profile->getAgent(), 'result' => 'agent-as-json')) |
|
118 | ); |
|
119 | ||
120 | $document = $this->client->getDocument($profile); |
|
121 | ||
122 | $this->assertInstanceOf('Xabbuh\XApi\Model\AgentProfileDocument', $document); |
|
123 | $this->assertEquals($profile, $document->getAgentProfile()); |
|
124 | } |
|
125 | ||
126 | private function createAgentProfile() |
|
127 | { |
@@ 102-125 (lines=24) @@ | ||
99 | $this->client->deleteDocument($state); |
|
100 | } |
|
101 | ||
102 | public function testGetDocument() |
|
103 | { |
|
104 | $document = DocumentFixtures::getStateDocument(); |
|
105 | $state = $document->getState(); |
|
106 | ||
107 | $this->validateRetrieveApiCall( |
|
108 | 'get', |
|
109 | 'activities/state', |
|
110 | array( |
|
111 | 'activityId' => 'activity-id', |
|
112 | 'agent' => 'agent-as-json', |
|
113 | 'stateId' => 'state-id', |
|
114 | ), |
|
115 | 200, |
|
116 | 'DocumentData', |
|
117 | $document->getData(), |
|
118 | array(array('data' => $state->getActor(), 'result' => 'agent-as-json')) |
|
119 | ); |
|
120 | ||
121 | $document = $this->client->getDocument($state); |
|
122 | ||
123 | $this->assertInstanceOf('Xabbuh\XApi\Model\StateDocument', $document); |
|
124 | $this->assertEquals($state, $document->getState()); |
|
125 | } |
|
126 | ||
127 | private function createState() |
|
128 | { |