Show
Ignore:
Timestamp:
04/12/08 21:11:11 (9 months ago)
Author:
romanb
Message:

Refactorings along with a speed improvement on the Hydrator when processing joined resultsets. Other minor tweaks.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests_old/Connection/UnitOfWork.php

    r3882 r4219  
    3535    public function testFlush()  
    3636    { 
     37        $uow = $this->connection->unitOfWork; 
     38         
    3739        $user = $this->connection->getTable('User')->find(4); 
    3840        $this->assertTrue(is_numeric($user->Phonenumber[0]->entity_id)); 
     
    6062        $this->assertTrue($user->Phonenumber[2]->entity_id instanceof User); 
    6163 
    62         $this->connection->flush(); 
     64        $uow->saveAll(); 
    6365 
    6466        $this->assertTrue(is_numeric($user->Phonenumber[0]->entity_id)); 
     
    9193        $this->assertTrue($user->Phonenumber->count() == 0); 
    9294 
    93         $this->connection->flush(); 
     95        $uow->saveAll(); 
    9496        unset($user); 
    9597        $user = $this->objTable->find(5); 
     
    103105 
    104106        $user->Phonenumber[1]->phonenumber = '123 123'; 
    105         $this->connection->flush(); 
     107        $uow->saveAll(); 
    106108 
    107109 
     
    113115 
    114116        $user->Phonenumber[3]->phonenumber = '123 123'; 
    115         $this->connection->flush(); 
     117        $uow->saveAll(); 
    116118 
    117119        $this->assertEqual($user->Phonenumber->count(), 3); 
     
    135137 
    136138        $this->assertEqual($user->Phonenumber->count(), 2); 
    137         $this->connection->flush(); 
     139        $uow->saveAll(); 
    138140 
    139141        $this->assertEqual($user->Phonenumber->count(), 2); 
     
    154156 
    155157        $user->Phonenumber = $coll; 
    156         $this->connection->flush(); 
     158        $uow->saveAll(); 
    157159        $this->assertEqual($user->Phonenumber->count(), 3); 
    158160        $user = $this->objTable->find(5); 
     
    164166        $user->Email->address = 'drinker@drinkmore.info'; 
    165167        $this->assertTrue($user->Email instanceof Email); 
    166         $this->connection->flush(); 
     168        $uow->saveAll(); 
    167169        $this->assertTrue($user->Email instanceof Email); 
    168170        $user = $this->objTable->find(5); 
     
    178180        $this->assertTrue($user->Email instanceof Email); 
    179181        $this->assertEqual($user->Email->address, 'absolutist@nottodrink.com'); 
    180         $this->connection->flush(); 
     182        $uow->saveAll(); 
    181183        unset($user); 
    182184 
     
    191193    public function testTransactions()  
    192194    { 
    193  
     195        $uow = $this->connection->unitOfWork; 
    194196        $this->connection->beginTransaction(); 
    195197        $this->assertEqual($this->connection->transaction->getState(),Doctrine_Transaction::STATE_ACTIVE); 
     
    202204         
    203205        $user->name = 'Jack Daniels'; 
    204         $this->connection->flush(); 
     206        $uow->saveAll(); 
    205207        $this->connection->commit(); 
    206208