2008-02-09 21:59:19 +03:00
|
|
|
<?php
|
2008-09-12 10:09:16 +04:00
|
|
|
|
2009-01-04 19:15:32 +03:00
|
|
|
#namespace Doctrine\Tests;
|
|
|
|
|
2008-09-12 21:25:38 +04:00
|
|
|
require_once 'lib/mocks/Doctrine_DriverMock.php';
|
2008-09-13 10:34:47 +04:00
|
|
|
require_once 'lib/mocks/Doctrine_ConnectionMock.php';
|
2008-09-12 10:09:16 +04:00
|
|
|
|
2008-02-09 21:59:19 +03:00
|
|
|
/**
|
2009-01-04 19:15:32 +03:00
|
|
|
* Base testcase class for all ORM testcases.
|
2008-02-09 21:59:19 +03:00
|
|
|
*/
|
|
|
|
class Doctrine_OrmTestCase extends Doctrine_TestCase
|
|
|
|
{
|
2009-01-04 19:15:32 +03:00
|
|
|
/**
|
|
|
|
* 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(
|
2008-09-12 21:25:38 +04:00
|
|
|
'driverClass' => 'Doctrine_DriverMock',
|
|
|
|
'wrapperClass' => 'Doctrine_ConnectionMock',
|
2008-06-15 19:56:28 +04:00
|
|
|
'user' => 'john',
|
2009-01-04 19:15:32 +03:00
|
|
|
'password' => 'wayne'
|
|
|
|
);
|
|
|
|
return Doctrine_ORM_EntityManager::create($connectionOptions, 'mockEM', $config, $eventManager);
|
2008-05-24 22:18:37 +04:00
|
|
|
}
|
|
|
|
}
|