1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/tests/lib/Doctrine_OrmTestCase.php
2009-01-04 16:15:32 +00:00

30 lines
912 B
PHP

<?php
#namespace Doctrine\Tests;
require_once 'lib/mocks/Doctrine_DriverMock.php';
require_once 'lib/mocks/Doctrine_ConnectionMock.php';
/**
* Base testcase class for all ORM testcases.
*/
class Doctrine_OrmTestCase extends Doctrine_TestCase
{
/**
* Creates an EntityManager for testing purposes.
*
* @return Doctrine\ORM\EntityManager
*/
protected function _getTestEntityManager($conf = null, $eventManager = null) {
$config = new Doctrine_ORM_Configuration();
$eventManager = new Doctrine_Common_EventManager();
$connectionOptions = array(
'driverClass' => 'Doctrine_DriverMock',
'wrapperClass' => 'Doctrine_ConnectionMock',
'user' => 'john',
'password' => 'wayne'
);
return Doctrine_ORM_EntityManager::create($connectionOptions, 'mockEM', $config, $eventManager);
}
}