2008-02-09 21:59:19 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Base testcase class for all dbal testcases.
|
|
|
|
*/
|
2008-02-10 17:32:05 +03:00
|
|
|
class Doctrine_DbalTestCase extends Doctrine_TestCase
|
2008-02-09 21:59:19 +03:00
|
|
|
{
|
2008-06-15 19:56:28 +04:00
|
|
|
protected $_conn;
|
|
|
|
|
2008-02-10 20:33:46 +03:00
|
|
|
/**
|
|
|
|
* setUp()
|
|
|
|
*
|
|
|
|
* Note: This setUp() and the one of OrmTestCase currently look identical. However,
|
|
|
|
* please dont pull this method up. In the future with a separation of Dbal/Orm
|
|
|
|
* this setUp() will take care of a DBAL connection and the ORM setUp() will take care
|
|
|
|
* of an ORM connection/session/manager.
|
|
|
|
*/
|
|
|
|
protected function setUp()
|
|
|
|
{
|
|
|
|
// Setup a db connection if there is none, yet. This makes it possible
|
|
|
|
// to run tests that use a connection standalone.
|
2008-06-15 19:56:28 +04:00
|
|
|
if (isset($this->sharedFixture['conn'])) {
|
|
|
|
$this->_conn = $this->sharedFixture['conn'];
|
|
|
|
} else {
|
|
|
|
$this->sharedFixture['conn'] = Doctrine_TestUtil::getConnection();
|
|
|
|
$this->_conn = $this->sharedFixture['conn'];
|
2008-02-10 20:33:46 +03:00
|
|
|
}
|
|
|
|
}
|
2008-02-09 21:59:19 +03:00
|
|
|
}
|