2008-02-09 18:59:19 +00:00
|
|
|
<?php
|
2008-09-12 06:09:16 +00:00
|
|
|
|
|
|
|
require_once 'lib/mocks/Doctrine_ConnectionMock.php';
|
|
|
|
|
2008-02-09 18:59:19 +00:00
|
|
|
/**
|
|
|
|
* Base testcase class for all orm testcases.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class Doctrine_OrmTestCase extends Doctrine_TestCase
|
|
|
|
{
|
2008-06-05 19:01:58 +00:00
|
|
|
protected $_em;
|
2008-06-15 15:56:28 +00:00
|
|
|
protected $_emf;
|
2008-06-05 19:01:58 +00:00
|
|
|
|
2008-05-24 18:18:37 +00:00
|
|
|
protected function setUp() {
|
2008-09-07 13:48:40 +00:00
|
|
|
if (isset($this->sharedFixture['em'])) {
|
2008-06-15 15:56:28 +00:00
|
|
|
$this->_em = $this->sharedFixture['em'];
|
2008-09-07 13:48:40 +00:00
|
|
|
} else {
|
|
|
|
$config = new Doctrine_Configuration();
|
|
|
|
$eventManager = new Doctrine_EventManager();
|
2008-06-15 15:56:28 +00:00
|
|
|
$connectionOptions = array(
|
2008-09-12 06:09:16 +00:00
|
|
|
'driverClass' => 'Doctrine_ConnectionMock',
|
2008-06-15 15:56:28 +00:00
|
|
|
'user' => 'john',
|
|
|
|
'password' => 'wayne'
|
2008-09-07 13:48:40 +00:00
|
|
|
);
|
|
|
|
$em = Doctrine_EntityManager::create($connectionOptions, 'mockEM', $config, $eventManager);
|
2008-06-15 15:56:28 +00:00
|
|
|
$this->_em = $em;
|
|
|
|
}
|
2008-09-07 13:48:40 +00:00
|
|
|
$this->_em->activate();
|
2008-05-24 18:18:37 +00:00
|
|
|
}
|
|
|
|
}
|