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

30 lines
912 B
PHP
Raw Normal View History

2008-02-09 21:59:19 +03:00
<?php
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';
require_once 'lib/mocks/Doctrine_ConnectionMock.php';
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',
'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
}
}