1
0
mirror of synced 2025-01-18 06:21:40 +03:00
doctrine2/tests/lib/Doctrine_DbalTestCase.php
2008-02-10 17:33:46 +00:00

25 lines
910 B
PHP

<?php
/**
* Base testcase class for all dbal testcases.
*/
class Doctrine_DbalTestCase extends Doctrine_TestCase
{
/**
* 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.
// @todo Make DBMS choice configurable
if ( ! isset($this->sharedFixture['connection'])) {
$pdo = new PDO('sqlite::memory:');
$this->sharedFixture['connection'] = Doctrine_Manager::connection($pdo, 'sqlite_memory');
}
}
}