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
373a0ac9
Commit
373a0ac9
authored
Feb 10, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes on the new test suite.
parent
36708c91
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
8 deletions
+46
-8
dbproperties.xml.dev
tests/dbproperties.xml.dev
+22
-0
DoctrineTestInit.php
tests/lib/DoctrineTestInit.php
+1
-0
Doctrine_DbalTestCase.php
tests/lib/Doctrine_DbalTestCase.php
+1
-2
Doctrine_DbalTestSuite.php
tests/lib/Doctrine_DbalTestSuite.php
+1
-2
Doctrine_OrmTestCase.php
tests/lib/Doctrine_OrmTestCase.php
+1
-2
Doctrine_OrmTestSuite.php
tests/lib/Doctrine_OrmTestSuite.php
+3
-2
Doctrine_TestUtil.php
tests/lib/Doctrine_TestUtil.php
+17
-0
No files found.
tests/dbproperties.xml.dev
0 → 100644
View file @
373a0ac9
<?xml version="1.0" encoding="utf-8"?>
<!--
Use this configuration file as a template to run the tests against any dbms.
Procedure:
1) Save a copy of this file with a name of your chosing. It doesn't matter
where you place it as long as you know where it is.
i.e. "mysqlconf.xml" (It needs the ending .xml).
2) Edit the file and fill in your settings (database name, type, username, etc.)
Just change the "value"s, not the names of the var elements.
3) To run the tests against the database type the following from within the
tests/ folder: phpunit --configuration <filename> ...
Example: phpunit --configuration mysqlconf.xml AllTests
-->
<phpunit>
<php>
<var
name=
"db_type"
value=
"mysql"
/>
<var
name=
"db_host"
value=
"localhost"
/>
<var
name=
"db_username"
value=
"foo"
/>
<var
name=
"db_password"
value=
"bar"
/>
<var
name=
"db_name"
value=
"doctrinetests"
/>
</php>
</phpunit>
\ No newline at end of file
tests/lib/DoctrineTestInit.php
View file @
373a0ac9
...
...
@@ -2,6 +2,7 @@
require_once
'PHPUnit/Framework.php'
;
require_once
'PHPUnit/TextUI/TestRunner.php'
;
require_once
'Doctrine_TestCase.php'
;
require_once
'Doctrine_TestUtil.php'
;
require_once
'Doctrine_DbalTestCase.php'
;
require_once
'Doctrine_OrmTestCase.php'
;
require_once
'Doctrine_TestSuite.php'
;
...
...
tests/lib/Doctrine_DbalTestCase.php
View file @
373a0ac9
...
...
@@ -18,8 +18,7 @@ class Doctrine_DbalTestCase extends Doctrine_TestCase
// 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'
);
$this
->
sharedFixture
[
'connection'
]
=
Doctrine_TestUtil
::
getConnection
();
}
}
}
\ No newline at end of file
tests/lib/Doctrine_DbalTestSuite.php
View file @
373a0ac9
...
...
@@ -12,8 +12,7 @@ class Doctrine_DbalTestSuite extends Doctrine_TestSuite
protected
function
setUp
()
{
// @todo Make DBMS choice configurable
$pdo
=
new
PDO
(
'sqlite::memory:'
);
$this
->
sharedFixture
[
'connection'
]
=
$this
->
loadConnection
(
$pdo
,
'sqlite_memory'
);
$this
->
sharedFixture
[
'connection'
]
=
Doctrine_TestUtil
::
getConnection
();
}
protected
function
loadConnection
(
$conn
,
$name
)
...
...
tests/lib/Doctrine_OrmTestCase.php
View file @
373a0ac9
...
...
@@ -36,8 +36,7 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
// 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'
);
$this
->
sharedFixture
[
'connection'
]
=
Doctrine_TestUtil
::
getConnection
();
}
}
...
...
tests/lib/Doctrine_OrmTestSuite.php
View file @
373a0ac9
...
...
@@ -11,8 +11,9 @@ class Doctrine_OrmTestSuite extends Doctrine_TestSuite
protected
function
setUp
()
{
// @todo Make DBMS choice configurable
$pdo
=
new
PDO
(
'sqlite::memory:'
);
$this
->
sharedFixture
[
'connection'
]
=
$this
->
loadConnection
(
$pdo
,
'sqlite_memory'
);
//$pdo = new PDO('sqlite::memory:');
//$this->sharedFixture['connection'] = $this->loadConnection($pdo, 'sqlite_memory');
$this
->
sharedFixture
[
'connection'
]
=
Doctrine_TestUtil
::
getConnection
();
}
protected
function
loadConnection
(
$conn
,
$name
)
...
...
tests/lib/Doctrine_TestUtil.php
0 → 100644
View file @
373a0ac9
<?php
class
Doctrine_TestUtil
{
public
static
function
getConnection
()
{
if
(
isset
(
$GLOBALS
[
'db_type'
],
$GLOBALS
[
'db_username'
],
$GLOBALS
[
'db_password'
],
$GLOBALS
[
'db_host'
],
$GLOBALS
[
'db_name'
]))
{
$dsn
=
"
{
$GLOBALS
[
'db_type'
]
}
://
{
$GLOBALS
[
'db_username'
]
}
:
{
$GLOBALS
[
'db_password'
]
}
@
{
$GLOBALS
[
'db_host'
]
}
/
{
$GLOBALS
[
'db_name'
]
}
"
;
return
Doctrine_Manager
::
connection
(
$dsn
,
'testconn'
);
}
else
{
return
Doctrine_Manager
::
connection
(
new
PDO
(
'sqlite::memory:'
),
'testconn'
);
}
}
}
\ No newline at end of file
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