changes on the new test suite.
This commit is contained in:
parent
99de12d7ac
commit
939a2bd638
@ -5,10 +5,33 @@
|
||||
*/
|
||||
class Doctrine_OrmTestCase extends Doctrine_TestCase
|
||||
{
|
||||
/**
|
||||
* The currently loaded model names of the fixtures for the testcase.
|
||||
*/
|
||||
private $_loadedFixtures = array();
|
||||
|
||||
/**
|
||||
* All loaded fixtures during test execution. Common fixture cache.
|
||||
* Shared across all test cases.
|
||||
*/
|
||||
private static $_fixtures = array();
|
||||
|
||||
/**
|
||||
* The names of all tables that were already exported. Each table is exported
|
||||
* only once. Then it's just filled & erased for each testmethod in a testcase
|
||||
* that uses one or more fixtures.
|
||||
*/
|
||||
private static $_exportedTables = array();
|
||||
|
||||
/**
|
||||
* 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
|
||||
* populated with fresh data of all loaded fixtures for each test method.
|
||||
*
|
||||
* @param string $package The package name. Must be one of Doctrine's test model packages
|
||||
* (forum, cms or ecommerce).
|
||||
* @param string $name The name of the fixture to load from the specified package.
|
||||
*/
|
||||
protected function loadFixture($package, $name)
|
||||
{
|
||||
$uniqueName = $package . '/' . $name;
|
||||
@ -43,6 +66,16 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads multiple fixtures of the same package.
|
||||
* This method must only be called from within the setUp() method of testcases.
|
||||
* The database will then be populated with fresh data of all loaded fixtures for each
|
||||
* test method.
|
||||
*
|
||||
* @param string $package The package name. Must be one of Doctrine's test model packages
|
||||
* (forum, cms or ecommerce).
|
||||
* @param array $names The names of the fixtures to load from the specified package.
|
||||
*/
|
||||
protected function loadFixtures($package, array $names)
|
||||
{
|
||||
foreach ($names as $name) {
|
||||
@ -50,6 +83,9 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sweeps the database tables of all used fixtures.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
$conn = $this->sharedFixture['connection'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user