Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
939a2bd6
Commit
939a2bd6
authored
Feb 10, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes on the new test suite.
parent
99de12d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
Doctrine_OrmTestCase.php
tests/lib/Doctrine_OrmTestCase.php
+36
-0
No files found.
tests/lib/Doctrine_OrmTestCase.php
View file @
939a2bd6
...
@@ -5,10 +5,33 @@
...
@@ -5,10 +5,33 @@
*/
*/
class
Doctrine_OrmTestCase
extends
Doctrine_TestCase
class
Doctrine_OrmTestCase
extends
Doctrine_TestCase
{
{
/**
* The currently loaded model names of the fixtures for the testcase.
*/
private
$_loadedFixtures
=
array
();
private
$_loadedFixtures
=
array
();
/**
* All loaded fixtures during test execution. Common fixture cache.
* Shared across all test cases.
*/
private
static
$_fixtures
=
array
();
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
();
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
)
protected
function
loadFixture
(
$package
,
$name
)
{
{
$uniqueName
=
$package
.
'/'
.
$name
;
$uniqueName
=
$package
.
'/'
.
$name
;
...
@@ -43,6 +66,16 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
...
@@ -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
)
protected
function
loadFixtures
(
$package
,
array
$names
)
{
{
foreach
(
$names
as
$name
)
{
foreach
(
$names
as
$name
)
{
...
@@ -50,6 +83,9 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
...
@@ -50,6 +83,9 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
}
}
}
}
/**
* Sweeps the database tables of all used fixtures.
*/
protected
function
tearDown
()
protected
function
tearDown
()
{
{
$conn
=
$this
->
sharedFixture
[
'connection'
];
$conn
=
$this
->
sharedFixture
[
'connection'
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment