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