1
0
Fork 0
mirror of synced 2025-03-31 20:06:16 +03:00

changes on the new test suite.

This commit is contained in:
romanb 2008-02-10 17:29:24 +00:00
parent 6329db601f
commit ba308004b4
4 changed files with 17 additions and 0 deletions

View file

@ -5,6 +5,7 @@ class Orm_Component_TestTest extends Doctrine_OrmTestCase
{ {
protected function setUp() protected function setUp()
{ {
parent::setUp();
$this->loadFixture('forum', 'common', 'users'); $this->loadFixture('forum', 'common', 'users');
} }

View file

@ -11,6 +11,7 @@ class Doctrine_DbalTestSuite extends Doctrine_TestSuite
protected function setUp() protected function setUp()
{ {
// @todo Make DBMS choice configurable
$pdo = new PDO('sqlite::memory:'); $pdo = new PDO('sqlite::memory:');
$this->sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory'); $this->sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory');
} }

View file

@ -22,6 +22,20 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
*/ */
private static $_exportedTables = array(); private static $_exportedTables = array();
/**
* setUp()
*/
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');
}
}
/** /**
* Loads a data fixture into the database. This method must only be called * Loads a data fixture into the database. This method must only be called
* from within the setUp() method of testcases. The database will then be * from within the setUp() method of testcases. The database will then be

View file

@ -10,6 +10,7 @@ class Doctrine_OrmTestSuite extends Doctrine_TestSuite
{ {
protected function setUp() protected function setUp()
{ {
// @todo Make DBMS choice configurable
$pdo = new PDO('sqlite::memory:'); $pdo = new PDO('sqlite::memory:');
$this->sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory'); $this->sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory');
} }