1
0
mirror of synced 2025-01-19 06:51:40 +03:00
doctrine2/tests/lib/Doctrine_OrmTestCase.php

30 lines
912 B
PHP
Raw Normal View History

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