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
2a9886af
Commit
2a9886af
authored
May 30, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Fixed connection sharing when Functional DBAL or ORM tests are run standalone.
parent
acec85a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
DbalFunctionalTestCase.php
tests/Doctrine/Tests/DbalFunctionalTestCase.php
+8
-4
OrmFunctionalTestCase.php
tests/Doctrine/Tests/OrmFunctionalTestCase.php
+8
-1
No files found.
tests/Doctrine/Tests/DbalFunctionalTestCase.php
View file @
2a9886af
...
@@ -4,15 +4,19 @@ namespace Doctrine\Tests;
...
@@ -4,15 +4,19 @@ namespace Doctrine\Tests;
class
DbalFunctionalTestCase
extends
DbalTestCase
class
DbalFunctionalTestCase
extends
DbalTestCase
{
{
/* Shared connection when a TestCase is run alone (outside of it's functional suite) */
private
static
$_sharedConn
;
protected
$_conn
;
protected
$_conn
;
protected
function
setUp
()
protected
function
setUp
()
{
{
if
(
!
isset
(
$this
->
_conn
))
{
if
(
isset
(
$this
->
sharedFixture
[
'conn'
]))
{
if
(
!
isset
(
$this
->
sharedFixture
[
'conn'
]))
{
$this
->
sharedFixture
[
'conn'
]
=
TestUtil
::
getConnection
();
}
$this
->
_conn
=
$this
->
sharedFixture
[
'conn'
];
$this
->
_conn
=
$this
->
sharedFixture
[
'conn'
];
}
else
{
if
(
!
isset
(
self
::
$_sharedConn
))
{
self
::
$_sharedConn
=
TestUtil
::
getConnection
();
}
$this
->
_conn
=
self
::
$_sharedConn
;
}
}
}
}
}
}
\ No newline at end of file
tests/Doctrine/Tests/OrmFunctionalTestCase.php
View file @
2a9886af
...
@@ -14,6 +14,9 @@ class OrmFunctionalTestCase extends OrmTestCase
...
@@ -14,6 +14,9 @@ class OrmFunctionalTestCase extends OrmTestCase
/* The query cache shared between all functional tests. */
/* The query cache shared between all functional tests. */
private
static
$_queryCacheImpl
=
null
;
private
static
$_queryCacheImpl
=
null
;
/* Shared connection when a TestCase is run alone (outside of it's functional suite) */
private
static
$_sharedConn
;
/** The EntityManager for this testcase. */
/** The EntityManager for this testcase. */
protected
$_em
;
protected
$_em
;
...
@@ -79,8 +82,12 @@ class OrmFunctionalTestCase extends OrmTestCase
...
@@ -79,8 +82,12 @@ class OrmFunctionalTestCase extends OrmTestCase
protected
function
setUp
()
protected
function
setUp
()
{
{
$forceCreateTables
=
false
;
$forceCreateTables
=
false
;
if
(
!
isset
(
$this
->
sharedFixture
[
'conn'
]))
{
if
(
!
isset
(
$this
->
sharedFixture
[
'conn'
]))
{
$this
->
sharedFixture
[
'conn'
]
=
TestUtil
::
getConnection
();
if
(
!
isset
(
self
::
$_sharedConn
))
{
self
::
$_sharedConn
=
TestUtil
::
getConnection
();
}
$this
->
sharedFixture
[
'conn'
]
=
self
::
$_sharedConn
;
if
(
$this
->
sharedFixture
[
'conn'
]
->
getDriver
()
instanceof
\Doctrine\DBAL\Driver\PDOSqlite\Driver
)
{
if
(
$this
->
sharedFixture
[
'conn'
]
->
getDriver
()
instanceof
\Doctrine\DBAL\Driver\PDOSqlite\Driver
)
{
$forceCreateTables
=
true
;
$forceCreateTables
=
true
;
}
}
...
...
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