Changeset 4219 for trunk/tests_old/Connection
- Timestamp:
- 04/12/08 21:11:11 (9 months ago)
- Files:
-
- 1 modified
-
trunk/tests_old/Connection/UnitOfWork.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests_old/Connection/UnitOfWork.php
r3882 r4219 35 35 public function testFlush() 36 36 { 37 $uow = $this->connection->unitOfWork; 38 37 39 $user = $this->connection->getTable('User')->find(4); 38 40 $this->assertTrue(is_numeric($user->Phonenumber[0]->entity_id)); … … 60 62 $this->assertTrue($user->Phonenumber[2]->entity_id instanceof User); 61 63 62 $ this->connection->flush();64 $uow->saveAll(); 63 65 64 66 $this->assertTrue(is_numeric($user->Phonenumber[0]->entity_id)); … … 91 93 $this->assertTrue($user->Phonenumber->count() == 0); 92 94 93 $ this->connection->flush();95 $uow->saveAll(); 94 96 unset($user); 95 97 $user = $this->objTable->find(5); … … 103 105 104 106 $user->Phonenumber[1]->phonenumber = '123 123'; 105 $ this->connection->flush();107 $uow->saveAll(); 106 108 107 109 … … 113 115 114 116 $user->Phonenumber[3]->phonenumber = '123 123'; 115 $ this->connection->flush();117 $uow->saveAll(); 116 118 117 119 $this->assertEqual($user->Phonenumber->count(), 3); … … 135 137 136 138 $this->assertEqual($user->Phonenumber->count(), 2); 137 $ this->connection->flush();139 $uow->saveAll(); 138 140 139 141 $this->assertEqual($user->Phonenumber->count(), 2); … … 154 156 155 157 $user->Phonenumber = $coll; 156 $ this->connection->flush();158 $uow->saveAll(); 157 159 $this->assertEqual($user->Phonenumber->count(), 3); 158 160 $user = $this->objTable->find(5); … … 164 166 $user->Email->address = 'drinker@drinkmore.info'; 165 167 $this->assertTrue($user->Email instanceof Email); 166 $ this->connection->flush();168 $uow->saveAll(); 167 169 $this->assertTrue($user->Email instanceof Email); 168 170 $user = $this->objTable->find(5); … … 178 180 $this->assertTrue($user->Email instanceof Email); 179 181 $this->assertEqual($user->Email->address, 'absolutist@nottodrink.com'); 180 $ this->connection->flush();182 $uow->saveAll(); 181 183 unset($user); 182 184 … … 191 193 public function testTransactions() 192 194 { 193 195 $uow = $this->connection->unitOfWork; 194 196 $this->connection->beginTransaction(); 195 197 $this->assertEqual($this->connection->transaction->getState(),Doctrine_Transaction::STATE_ACTIVE); … … 202 204 203 205 $user->name = 'Jack Daniels'; 204 $ this->connection->flush();206 $uow->saveAll(); 205 207 $this->connection->commit(); 206 208