diff --git a/tests/lib/Doctrine_DbalTestCase.php b/tests/lib/Doctrine_DbalTestCase.php index abb227589..28ab8f475 100644 --- a/tests/lib/Doctrine_DbalTestCase.php +++ b/tests/lib/Doctrine_DbalTestCase.php @@ -4,5 +4,22 @@ */ 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'); + } + } } \ No newline at end of file diff --git a/tests/lib/Doctrine_OrmTestCase.php b/tests/lib/Doctrine_OrmTestCase.php index f854043fd..234d8c2f5 100644 --- a/tests/lib/Doctrine_OrmTestCase.php +++ b/tests/lib/Doctrine_OrmTestCase.php @@ -24,6 +24,11 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase /** * setUp() + * + * Note: This setUp() and the one of DbalTestCase 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 ORM connection/session/manager initialization + * and the DBAL setUp() will take care of just a DBAL connection. */ protected function setUp() {