| @@ 43-62 (lines=20) @@ | ||
| 40 | ); |
|
| 41 | } |
|
| 42 | ||
| 43 | public function testCreateOrUpdateDocument() |
|
| 44 | { |
|
| 45 | $document = DocumentFixtures::getStateDocument(); |
|
| 46 | ||
| 47 | $this->validateStoreApiCall( |
|
| 48 | 'post', |
|
| 49 | 'activities/state', |
|
| 50 | array( |
|
| 51 | 'activityId' => 'activity-id', |
|
| 52 | 'agent' => 'agent-as-json', |
|
| 53 | 'stateId' => 'state-id', |
|
| 54 | ), |
|
| 55 | 204, |
|
| 56 | '', |
|
| 57 | $document->getData(), |
|
| 58 | array(array('data' => $document->getState()->getActor(), 'result' => 'agent-as-json')) |
|
| 59 | ); |
|
| 60 | ||
| 61 | $this->client->createOrUpdateDocument($document); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function testCreateOrReplaceDocument() |
|
| 65 | { |
|
| @@ 64-83 (lines=20) @@ | ||
| 61 | $this->client->createOrUpdateDocument($document); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function testCreateOrReplaceDocument() |
|
| 65 | { |
|
| 66 | $document = DocumentFixtures::getStateDocument(); |
|
| 67 | ||
| 68 | $this->validateStoreApiCall( |
|
| 69 | 'put', |
|
| 70 | 'activities/state', |
|
| 71 | array( |
|
| 72 | 'activityId' => 'activity-id', |
|
| 73 | 'agent' => 'agent-as-json', |
|
| 74 | 'stateId' => 'state-id', |
|
| 75 | ), |
|
| 76 | 204, |
|
| 77 | '', |
|
| 78 | $document->getData(), |
|
| 79 | array(array('data' => $document->getState()->getActor(), 'result' => 'agent-as-json')) |
|
| 80 | ); |
|
| 81 | ||
| 82 | $this->client->createOrReplaceDocument($document); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testDeleteDocument() |
|
| 86 | { |
|