Changeset 4723 for trunk/tests/Orm

Show
Ignore:
Timestamp:
08/01/08 19:46:14 (5 months ago)
Author:
romanb
Message:

Continued refactorings. Started to refactor the DBAL layer.

Location:
trunk/tests/Orm
Files:
2 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/Orm/UnitOfWorkTest.php

    r4718 r4723  
    2424    // The EntityManager mock that provides the mock persister 
    2525    private $_emMock; 
     26    private $_platformMock; 
    2627     
    2728    protected function setUp() { 
     
    3334 
    3435        $this->_connectionMock = new Doctrine_ConnectionMock(array()); 
    35         $this->_sequenceMock = $this->_connectionMock->getSequenceManager(); 
     36        $this->_platformMock = new Doctrine_DatabasePlatformMock(); 
    3637        $this->_emMock = new Doctrine_EntityManagerMock($this->_connectionMock); 
    37         $this->_persisterMock = $this->_emMock->getEntityPersister("ForumUser"); 
     38        $this->_sequenceMock = new Doctrine_SequenceMock($this->_connectionMock); 
     39 
     40        $this->_connectionMock->setSequenceManager($this->_sequenceMock); 
     41        $this->_connectionMock->setDatabasePlatform($this->_platformMock); 
     42         
     43        $this->_persisterMock = new Doctrine_EntityPersisterMock( 
     44                $this->_emMock, $this->_emMock->getClassMetadata("ForumUser")); 
     45        $this->_emMock->setEntityPersister($this->_persisterMock); 
     46         
    3847        $this->_unitOfWork = $this->_emMock->getUnitOfWork(); 
    3948    } 
     
    106115        $this->assertTrue(is_numeric($this->_user->id)); 
    107116         
    108         // Now lets check whether a subsequence commit() does anything 
     117        // Now lets check whether a subsequent commit() does anything 
    109118         
    110119        $this->_persisterMock->reset();