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
e929180c
Commit
e929180c
authored
Feb 10, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes on the new test suite.
parent
939a2bd6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
TestTest.php
tests/Orm/Component/TestTest.php
+1
-1
users.php
tests/fixtures/forum/common/users.php
+0
-0
Doctrine_OrmTestCase.php
tests/lib/Doctrine_OrmTestCase.php
+9
-7
No files found.
tests/Orm/Component/TestTest.php
View file @
e929180c
...
@@ -5,7 +5,7 @@ class Orm_Component_TestTest extends Doctrine_OrmTestCase
...
@@ -5,7 +5,7 @@ class Orm_Component_TestTest extends Doctrine_OrmTestCase
{
{
protected
function
setUp
()
protected
function
setUp
()
{
{
$this
->
loadFixture
(
'forum'
,
'common
_
users'
);
$this
->
loadFixture
(
'forum'
,
'common
'
,
'
users'
);
}
}
public
function
testTest
()
public
function
testTest
()
...
...
tests/fixtures/forum/common
_
users.php
→
tests/fixtures/forum/common
/
users.php
View file @
e929180c
File moved
tests/lib/Doctrine_OrmTestCase.php
View file @
e929180c
...
@@ -12,7 +12,6 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
...
@@ -12,7 +12,6 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
/**
/**
* All loaded fixtures during test execution. Common fixture cache.
* All loaded fixtures during test execution. Common fixture cache.
* Shared across all test cases.
*/
*/
private
static
$_fixtures
=
array
();
private
static
$_fixtures
=
array
();
...
@@ -32,14 +31,17 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
...
@@ -32,14 +31,17 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
* (forum, cms or ecommerce).
* (forum, cms or ecommerce).
* @param string $name The name of the fixture to load from the specified package.
* @param string $name The name of the fixture to load from the specified package.
*/
*/
protected
function
loadFixture
(
$package
,
$name
)
protected
function
loadFixture
(
$package
,
$
scenario
,
$
name
)
{
{
$uniqueName
=
$package
.
'/'
.
$name
;
$uniqueName
=
$package
.
'/'
.
$
scenario
.
'/'
.
$
name
;
if
(
!
isset
(
self
::
$_fixtures
[
$uniqueName
]))
{
if
(
!
isset
(
self
::
$_fixtures
[
$uniqueName
]))
{
// load fixture file
// load fixture file
$fixtureFile
=
'fixtures'
.
DIRECTORY_SEPARATOR
.
$package
.
DIRECTORY_SEPARATOR
$fixtureFile
=
'fixtures'
.
$name
.
'.php'
;
.
DIRECTORY_SEPARATOR
.
$package
.
DIRECTORY_SEPARATOR
.
$scenario
.
DIRECTORY_SEPARATOR
.
$name
.
'.php'
;
require
$fixtureFile
;
require
$fixtureFile
;
self
::
$_fixtures
[
$uniqueName
]
=
$fixture
;
self
::
$_fixtures
[
$uniqueName
]
=
$fixture
;
...
@@ -76,10 +78,10 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
...
@@ -76,10 +78,10 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
* (forum, cms or ecommerce).
* (forum, cms or ecommerce).
* @param array $names The names of the fixtures to load from the specified package.
* @param array $names The names of the fixtures to load from the specified package.
*/
*/
protected
function
loadFixtures
(
$package
,
array
$names
)
protected
function
loadFixtures
(
$package
,
$scenario
,
array
$names
)
{
{
foreach
(
$names
as
$name
)
{
foreach
(
$names
as
$name
)
{
$this
->
loadFixture
(
$package
,
$name
);
$this
->
loadFixture
(
$package
,
$
scenario
,
$
name
);
}
}
}
}
...
...
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