@@ 144-154 (lines=11) @@ | ||
141 | $this->assertEquals(2, $jane->getProperty('country_id', 'users')); |
|
142 | } |
|
143 | ||
144 | public function testUpdatePrimaryKey() |
|
145 | { |
|
146 | $object = new TDBMObject('rights'); |
|
147 | $object->setProperty('label', 'CAN_EDIT_BOUK'); |
|
148 | ||
149 | $this->tdbmService->save($object); |
|
150 | ||
151 | $object->setProperty('label', 'CAN_EDIT_BOOK'); |
|
152 | ||
153 | $this->tdbmService->save($object); |
|
154 | } |
|
155 | ||
156 | /** |
|
157 | * @expectedException \TheCodingMachine\TDBM\TDBMInvalidOperationException |
|
@@ 187-200 (lines=14) @@ | ||
184 | $this->assertTrue($exceptionRaised); |
|
185 | } |
|
186 | ||
187 | public function testDeleteLoadedObject() |
|
188 | { |
|
189 | $object = new TDBMObject('rights'); |
|
190 | $object->setProperty('label', 'CAN_DELETE'); |
|
191 | ||
192 | $this->tdbmService->save($object); |
|
193 | ||
194 | $object->setProperty('label', 'CAN_DELETE2'); |
|
195 | ||
196 | $this->tdbmService->delete($object); |
|
197 | ||
198 | // Try to delete a deleted object (this should do nothing) |
|
199 | $this->tdbmService->delete($object); |
|
200 | } |
|
201 | ||
202 | public function testFindObjects() |
|
203 | { |