1 | <?php |
||
9 | class PhpcrOdmAgentTest extends PhpcrOdmTestCase |
||
10 | { |
||
11 | private $agent; |
||
12 | private $documentManager; |
||
|
|||
13 | |||
14 | public function setUp() |
||
21 | |||
22 | /** |
||
23 | * It should find a document. |
||
24 | */ |
||
25 | public function testFind() |
||
32 | |||
33 | /** |
||
34 | * It should throw an exception if the document was not found. |
||
35 | * |
||
36 | * @expectedException Psi\Component\ObjectAgent\Exception\ObjectNotFoundException |
||
37 | * @expectedExceptionMessage Could not find document with identifier "/test/foobar" (class "<null>") |
||
38 | */ |
||
39 | public function testFindNotFound() |
||
43 | |||
44 | /** |
||
45 | * It should save. |
||
46 | */ |
||
47 | public function testSave() |
||
57 | |||
58 | /** |
||
59 | * It should delete. |
||
60 | */ |
||
61 | public function testDelete() |
||
69 | |||
70 | /** |
||
71 | * It should return a document's identifier (a UUID) |
||
72 | */ |
||
73 | public function testGetIdentifier() |
||
79 | |||
80 | /** |
||
81 | * It should throw an exception if the document does not have a mapped UUID field. |
||
82 | * |
||
83 | * @expectedException \RuntimeException |
||
84 | * @expectedExceptionMessage does not have a UUID-mapped property |
||
85 | */ |
||
86 | public function testGetIdentifierNoMappedUuid() |
||
94 | |||
95 | /** |
||
96 | * It should set the parent document on a given document. |
||
97 | */ |
||
98 | public function testSetParent() |
||
111 | |||
112 | /** |
||
113 | * It should throw an exception if attempting to set parent on a document with no parent mapping. |
||
114 | * |
||
115 | * @expectedException \RuntimeException |
||
116 | * @expectedExceptionMessage does not have a ParentDocument mapping |
||
117 | */ |
||
118 | public function testSetParentNoParentMapping() |
||
125 | |||
126 | /** |
||
127 | * It should say if it supports a given object. |
||
128 | */ |
||
129 | public function testSupports() |
||
134 | |||
135 | private function createPage() |
||
144 | } |
||
145 |