|
@@ 81-92 (lines=12) @@
|
| 78 |
|
* @dataProvider getStateDocument |
| 79 |
|
* @expectedException \Xabbuh\XApi\Common\Exception\NotFoundException |
| 80 |
|
*/ |
| 81 |
|
public function testDeletedStateDocumentIsDeleted(StateDocument $stateDocument) |
| 82 |
|
{ |
| 83 |
|
$this->stateDocumentRepository->save($stateDocument); |
| 84 |
|
$this->stateDocumentRepository->delete($stateDocument); |
| 85 |
|
|
| 86 |
|
$criteria = new StateDocumentsFilter(); |
| 87 |
|
$criteria |
| 88 |
|
->byActivity($stateDocument->getState()->getActivity()) |
| 89 |
|
->byAgent($stateDocument->getState()->getActor()); |
| 90 |
|
|
| 91 |
|
$this->stateDocumentRepository->find($stateDocument->getState()->getStateId(), $criteria); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
/** |
| 95 |
|
* @dataProvider getStateDocument |
|
@@ 120-132 (lines=13) @@
|
| 117 |
|
* @dataProvider getStateDocument |
| 118 |
|
* @expectedException \Xabbuh\XApi\Common\Exception\NotFoundException |
| 119 |
|
*/ |
| 120 |
|
public function testCommitDeleteDeferredStateDocument(StateDocument $stateDocument) |
| 121 |
|
{ |
| 122 |
|
$this->stateDocumentRepository->save($stateDocument); |
| 123 |
|
$this->stateDocumentRepository->deleteDeferred($stateDocument); |
| 124 |
|
$this->stateDocumentRepository->commit(); |
| 125 |
|
|
| 126 |
|
$criteria = new StateDocumentsFilter(); |
| 127 |
|
$criteria |
| 128 |
|
->byActivity($stateDocument->getState()->getActivity()) |
| 129 |
|
->byAgent($stateDocument->getState()->getActor()); |
| 130 |
|
|
| 131 |
|
$this->stateDocumentRepository->find($stateDocument->getState()->getStateId(), $criteria); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
public function getStateDocument() |
| 135 |
|
{ |