From 373a0ac994ae4fa99e54b6984839d7bb4a1c7281 Mon Sep 17 00:00:00 2001 From: romanb Date: Sun, 10 Feb 2008 19:08:31 +0000 Subject: [PATCH] changes on the new test suite. --- tests/dbproperties.xml.dev | 22 ++++++++++++++++++++++ tests/lib/DoctrineTestInit.php | 1 + tests/lib/Doctrine_DbalTestCase.php | 3 +-- tests/lib/Doctrine_DbalTestSuite.php | 3 +-- tests/lib/Doctrine_OrmTestCase.php | 3 +-- tests/lib/Doctrine_OrmTestSuite.php | 5 +++-- tests/lib/Doctrine_TestUtil.php | 17 +++++++++++++++++ 7 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 tests/dbproperties.xml.dev create mode 100644 tests/lib/Doctrine_TestUtil.php diff --git a/tests/dbproperties.xml.dev b/tests/dbproperties.xml.dev new file mode 100644 index 000000000..9e4f63fa2 --- /dev/null +++ b/tests/dbproperties.xml.dev @@ -0,0 +1,22 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tests/lib/DoctrineTestInit.php b/tests/lib/DoctrineTestInit.php index cd3f6af4e..93bc0bbf3 100644 --- a/tests/lib/DoctrineTestInit.php +++ b/tests/lib/DoctrineTestInit.php @@ -2,6 +2,7 @@ require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/TextUI/TestRunner.php'; require_once 'Doctrine_TestCase.php'; +require_once 'Doctrine_TestUtil.php'; require_once 'Doctrine_DbalTestCase.php'; require_once 'Doctrine_OrmTestCase.php'; require_once 'Doctrine_TestSuite.php'; diff --git a/tests/lib/Doctrine_DbalTestCase.php b/tests/lib/Doctrine_DbalTestCase.php index 28ab8f475..597c0cacf 100644 --- a/tests/lib/Doctrine_DbalTestCase.php +++ b/tests/lib/Doctrine_DbalTestCase.php @@ -18,8 +18,7 @@ class Doctrine_DbalTestCase extends Doctrine_TestCase // 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'); + $this->sharedFixture['connection'] = Doctrine_TestUtil::getConnection(); } } } \ No newline at end of file diff --git a/tests/lib/Doctrine_DbalTestSuite.php b/tests/lib/Doctrine_DbalTestSuite.php index a9996c237..22b17546e 100644 --- a/tests/lib/Doctrine_DbalTestSuite.php +++ b/tests/lib/Doctrine_DbalTestSuite.php @@ -12,8 +12,7 @@ class Doctrine_DbalTestSuite extends Doctrine_TestSuite protected function setUp() { // @todo Make DBMS choice configurable - $pdo = new PDO('sqlite::memory:'); - $this->sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory'); + $this->sharedFixture['connection'] = Doctrine_TestUtil::getConnection(); } protected function loadConnection($conn, $name) diff --git a/tests/lib/Doctrine_OrmTestCase.php b/tests/lib/Doctrine_OrmTestCase.php index 234d8c2f5..e0f311140 100644 --- a/tests/lib/Doctrine_OrmTestCase.php +++ b/tests/lib/Doctrine_OrmTestCase.php @@ -36,8 +36,7 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase // 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'); + $this->sharedFixture['connection'] = Doctrine_TestUtil::getConnection(); } } diff --git a/tests/lib/Doctrine_OrmTestSuite.php b/tests/lib/Doctrine_OrmTestSuite.php index d3cb7968f..7506a86b9 100644 --- a/tests/lib/Doctrine_OrmTestSuite.php +++ b/tests/lib/Doctrine_OrmTestSuite.php @@ -11,8 +11,9 @@ class Doctrine_OrmTestSuite extends Doctrine_TestSuite protected function setUp() { // @todo Make DBMS choice configurable - $pdo = new PDO('sqlite::memory:'); - $this->sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory'); + //$pdo = new PDO('sqlite::memory:'); + //$this->sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory'); + $this->sharedFixture['connection'] = Doctrine_TestUtil::getConnection(); } protected function loadConnection($conn, $name) diff --git a/tests/lib/Doctrine_TestUtil.php b/tests/lib/Doctrine_TestUtil.php new file mode 100644 index 000000000..e34e7176d --- /dev/null +++ b/tests/lib/Doctrine_TestUtil.php @@ -0,0 +1,17 @@ +