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