1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/tests/lib/mocks/Doctrine_UnitOfWorkMock.php
2008-12-18 14:08:11 +00:00

32 lines
761 B
PHP

<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Doctrine_UnitOfWorkMock
*
* @author robo
*/
class Doctrine_UnitOfWorkMock extends Doctrine_ORM_UnitOfWork {
private $_mockDataChangeSets = array();
/**
* @param <type> $entity
* @override
*/
public function getDataChangeSet($entity) {
$oid = spl_object_id($entity);
return isset($this->_mockDataChangeSets[$oid]) ?
$this->_mockDataChangeSets[$oid] : parent::getDataChangeSet($entity);
}
/* MOCK API */
public function setDataChangeSet($entity, array $mockChangeSet) {
$this->_mockDataChangeSets[spl_object_id($entity)] = $mockChangeSet;
}
}