diff --git a/tests/Dbal/AllTests.php b/tests/Dbal/AllTests.php index aa04f07af..307d86ebf 100644 --- a/tests/Dbal/AllTests.php +++ b/tests/Dbal/AllTests.php @@ -17,7 +17,7 @@ class Dbal_AllTests public static function suite() { - $suite = new Doctrine_TestSuite('Doctrine Dbal'); + $suite = new Doctrine_DbalTestSuite('Doctrine Dbal'); $suite->addTest(Dbal_Component_AllTests::suite()); diff --git a/tests/Dbal/Component/TestTest.php b/tests/Dbal/Component/TestTest.php index 798b1c86d..71fe58b55 100644 --- a/tests/Dbal/Component/TestTest.php +++ b/tests/Dbal/Component/TestTest.php @@ -1,7 +1,7 @@ addTest(Orm_Component_AllTests::suite()); diff --git a/tests/Orm/Component/TestTest.php b/tests/Orm/Component/TestTest.php index 94c678dcf..52af8a462 100644 --- a/tests/Orm/Component/TestTest.php +++ b/tests/Orm/Component/TestTest.php @@ -1,7 +1,7 @@ sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory'); + } + + protected function loadConnection($conn, $name) + { + return Doctrine_Manager::connection($conn, $name); + } + + protected function tearDown() + { + Doctrine_Manager::getInstance()->getConnection('sqlite_memory')->close(); + $this->sharedFixture = NULL; + } + +} \ No newline at end of file diff --git a/tests/lib/Doctrine_OrmTestCase.php b/tests/lib/Doctrine_OrmTestCase.php new file mode 100644 index 000000000..8130573ae --- /dev/null +++ b/tests/lib/Doctrine_OrmTestCase.php @@ -0,0 +1,26 @@ +importData($dataPath, 'yml', $models); + } +} \ No newline at end of file diff --git a/tests/lib/Doctrine_OrmTestSuite.php b/tests/lib/Doctrine_OrmTestSuite.php new file mode 100644 index 000000000..8153fc599 --- /dev/null +++ b/tests/lib/Doctrine_OrmTestSuite.php @@ -0,0 +1,27 @@ +sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory'); + } + + protected function loadConnection($conn, $name) + { + return Doctrine_Manager::connection($conn, $name); + } + + protected function tearDown() + { + Doctrine_Manager::getInstance()->getConnection('sqlite_memory')->close(); + $this->sharedFixture = NULL; + } +} \ No newline at end of file diff --git a/tests/lib/Doctrine_TestCase.php b/tests/lib/Doctrine_TestCase.php index f1f8324a0..65724d9e4 100644 --- a/tests/lib/Doctrine_TestCase.php +++ b/tests/lib/Doctrine_TestCase.php @@ -1,39 +1,8 @@ sharedFixture = $this->loadConnection($pdo, 'sqlite_memory'); - } - - public function loadConnection($conn, $name) - { - return Doctrine_Manager::connection($conn, $name); - } - - public function loadFixturesPackage($package, $models = array()) - { - $packagePath = 'fixtures' . DIRECTORY_SEPARATOR . $package; - - if ( ! file_exists($packagePath)) { - throw new Exception('Could not find fixtures package: "' . $package . '"'); - } - - $modelsPath = $packagePath . DIRECTORY_SEPARATOR . 'models'; - $dataPath = $packagePath . DIRECTORY_SEPARATOR . 'data'; - - Doctrine::loadModels($modelsPath); - Doctrine::createTablesFromModels($modelsPath); - - $data = new Doctrine_Data(); - $data->importData($dataPath, 'yml', $models); - } - - public function tearDown() - { - Doctrine_Manager::getInstance()->getConnection('sqlite_memory')->close(); - - $this->sharedFixture = NULL; - } + } \ No newline at end of file diff --git a/tests/lib/Doctrine_TestSuite.php b/tests/lib/Doctrine_TestSuite.php index e866e1b3c..e0c0e283e 100644 --- a/tests/lib/Doctrine_TestSuite.php +++ b/tests/lib/Doctrine_TestSuite.php @@ -1,5 +1,9 @@