1
0
mirror of synced 2024-12-15 23:56:02 +03:00
doctrine2/tests/lib/mocks/Doctrine_UnitOfWorkMock.php

32 lines
761 B
PHP
Raw Normal View History

<?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;
}
}