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