@@ 58-70 (lines=13) @@ | ||
55 | /** |
|
56 | * @dataProvider getStateDocument |
|
57 | */ |
|
58 | public function testCreatedStateDocumentCanBeRetrievedByOriginal(StateDocument $stateDocument) |
|
59 | { |
|
60 | $this->stateDocumentRepository->storeStateDocument($stateDocument); |
|
61 | ||
62 | $criteria = new StateDocumentsFilter(); |
|
63 | $criteria |
|
64 | ->byActivity($stateDocument->getState()->getActivity()) |
|
65 | ->byAgent($stateDocument->getState()->getActor()); |
|
66 | ||
67 | $fetchedStateDocument = $this->stateDocumentRepository->findStateDocumentBy($stateDocument->getState()->getStateId(), $criteria); |
|
68 | ||
69 | $this->assertTrue($stateDocument->equals($fetchedStateDocument)); |
|
70 | } |
|
71 | ||
72 | /** |
|
73 | * @dataProvider getStateDocument |
|
@@ 76-87 (lines=12) @@ | ||
73 | * @dataProvider getStateDocument |
|
74 | * @expectedException \Xabbuh\XApi\Common\Exception\NotFoundException |
|
75 | */ |
|
76 | public function testDeletedStatementIsDeleted(StateDocument $stateDocument) |
|
77 | { |
|
78 | $this->stateDocumentRepository->storeStateDocument($stateDocument); |
|
79 | $this->stateDocumentRepository->deleteStateDocument($stateDocument); |
|
80 | ||
81 | $criteria = new StateDocumentsFilter(); |
|
82 | $criteria |
|
83 | ->byActivity($stateDocument->getState()->getActivity()) |
|
84 | ->byAgent($stateDocument->getState()->getActor()); |
|
85 | ||
86 | $this->stateDocumentRepository->findStateDocumentBy($stateDocument->getState()->getStateId(), $criteria); |
|
87 | } |
|
88 | ||
89 | public function getStateDocument() |
|
90 | { |