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
00fa362e
Commit
00fa362e
authored
Feb 09, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to the new test setup.
parent
e757ccc5
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
107 additions
and
40 deletions
+107
-40
AllTests.php
tests/Dbal/AllTests.php
+1
-1
TestTest.php
tests/Dbal/Component/TestTest.php
+1
-1
AllTests.php
tests/Orm/AllTests.php
+1
-1
TestTest.php
tests/Orm/Component/TestTest.php
+1
-1
DoctrineTestInit.php
tests/lib/DoctrineTestInit.php
+4
-0
Doctrine_DbalTestCase.php
tests/lib/Doctrine_DbalTestCase.php
+8
-0
Doctrine_DbalTestSuite.php
tests/lib/Doctrine_DbalTestSuite.php
+29
-0
Doctrine_OrmTestCase.php
tests/lib/Doctrine_OrmTestCase.php
+26
-0
Doctrine_OrmTestSuite.php
tests/lib/Doctrine_OrmTestSuite.php
+27
-0
Doctrine_TestCase.php
tests/lib/Doctrine_TestCase.php
+4
-35
Doctrine_TestSuite.php
tests/lib/Doctrine_TestSuite.php
+5
-1
No files found.
tests/Dbal/AllTests.php
View file @
00fa362e
...
...
@@ -17,7 +17,7 @@ class Dbal_AllTests
public
static
function
suite
()
{
$suite
=
new
Doctrine_TestSuite
(
'Doctrine Dbal'
);
$suite
=
new
Doctrine_
Dbal
TestSuite
(
'Doctrine Dbal'
);
$suite
->
addTest
(
Dbal_Component_AllTests
::
suite
());
...
...
tests/Dbal/Component/TestTest.php
View file @
00fa362e
<?php
require_once
'lib/DoctrineTestInit.php'
;
class
Dbal_Component_TestTest
extends
Doctrine_TestCase
class
Dbal_Component_TestTest
extends
Doctrine_
Dbal
TestCase
{
public
function
testTest
()
{
...
...
tests/Orm/AllTests.php
View file @
00fa362e
...
...
@@ -17,7 +17,7 @@ class Orm_AllTests
public
static
function
suite
()
{
$suite
=
new
Doctrine_TestSuite
(
'Doctrine Orm'
);
$suite
=
new
Doctrine_
Orm
TestSuite
(
'Doctrine Orm'
);
$suite
->
addTest
(
Orm_Component_AllTests
::
suite
());
...
...
tests/Orm/Component/TestTest.php
View file @
00fa362e
<?php
require_once
'lib/DoctrineTestInit.php'
;
class
Orm_Component_TestTest
extends
Doctrine_TestCase
class
Orm_Component_TestTest
extends
Doctrine_
Orm
TestCase
{
public
function
testTest
()
{
...
...
tests/lib/DoctrineTestInit.php
View file @
00fa362e
...
...
@@ -2,7 +2,11 @@
require_once
'PHPUnit/Framework.php'
;
require_once
'PHPUnit/TextUI/TestRunner.php'
;
require_once
'Doctrine_TestCase.php'
;
require_once
'Doctrine_DbalTestCase.php'
;
require_once
'Doctrine_OrmTestCase.php'
;
require_once
'Doctrine_TestSuite.php'
;
require_once
'Doctrine_OrmTestSuite.php'
;
require_once
'Doctrine_DbalTestSuite.php'
;
require_once
'../lib/Doctrine.php'
;
spl_autoload_register
(
array
(
'Doctrine'
,
'autoload'
));
\ No newline at end of file
tests/lib/Doctrine_DbalTestCase.php
0 → 100644
View file @
00fa362e
<?php
/**
* Base testcase class for all dbal testcases.
*/
class
Doctrine_DbalTestCase
extends
PHPUnit_Framework_TestCase
{
}
\ No newline at end of file
tests/lib/Doctrine_DbalTestSuite.php
0 → 100644
View file @
00fa362e
<?php
/**
* The outermost test suite for all dbal related testcases & suites.
*
* Currently the dbal suite uses a normal connection object, too, just like the orm suite.
* Upon separation of the DBAL and ORM package this suite should just use a DBAL
* connection in the shared fixture.
*/
class
Doctrine_DbalTestSuite
extends
Doctrine_TestSuite
{
protected
function
setUp
()
{
$pdo
=
new
PDO
(
'sqlite::memory:'
);
$this
->
sharedFixture
[
'connection'
]
=
$this
->
loadConnection
(
$pdo
,
'sqlite_memory'
);
}
protected
function
loadConnection
(
$conn
,
$name
)
{
return
Doctrine_Manager
::
connection
(
$conn
,
$name
);
}
protected
function
tearDown
()
{
Doctrine_Manager
::
getInstance
()
->
getConnection
(
'sqlite_memory'
)
->
close
();
$this
->
sharedFixture
=
NULL
;
}
}
\ No newline at end of file
tests/lib/Doctrine_OrmTestCase.php
0 → 100644
View file @
00fa362e
<?php
/**
* Base testcase class for all orm testcases.
*
* Provides the testcases with fixture support and other orm related capabilities.
*/
class
Doctrine_OrmTestCase
extends
Doctrine_TestCase
{
public
function
loadFixturesPackage
(
$package
,
$models
=
array
())
{
$packagePath
=
'fixtures'
.
DIRECTORY_SEPARATOR
.
$package
;
if
(
!
file_exists
(
$packagePath
))
{
throw
new
Exception
(
"Could not find fixtures package:
$package
."
);
}
$modelsPath
=
$packagePath
.
DIRECTORY_SEPARATOR
.
'models'
;
$dataPath
=
$packagePath
.
DIRECTORY_SEPARATOR
.
'data'
;
Doctrine
::
loadModels
(
$modelsPath
);
Doctrine
::
createTablesFromModels
(
$modelsPath
);
$data
=
new
Doctrine_Data
();
$data
->
importData
(
$dataPath
,
'yml'
,
$models
);
}
}
\ No newline at end of file
tests/lib/Doctrine_OrmTestSuite.php
0 → 100644
View file @
00fa362e
<?php
/**
* The outermost test suite for all orm related testcases & suites.
*
* Currently the orm suite uses a normal connection object.
* Upon separation of the DBAL and ORM package this suite should just use a orm
* connection/session/manager instance as the shared fixture.
*/
class
Doctrine_OrmTestSuite
extends
Doctrine_TestSuite
{
protected
function
setUp
()
{
$pdo
=
new
PDO
(
'sqlite::memory:'
);
$this
->
sharedFixture
[
'connection'
]
=
$this
->
loadConnection
(
$pdo
,
'sqlite_memory'
);
}
protected
function
loadConnection
(
$conn
,
$name
)
{
return
Doctrine_Manager
::
connection
(
$conn
,
$name
);
}
protected
function
tearDown
()
{
Doctrine_Manager
::
getInstance
()
->
getConnection
(
'sqlite_memory'
)
->
close
();
$this
->
sharedFixture
=
NULL
;
}
}
\ No newline at end of file
tests/lib/Doctrine_TestCase.php
View file @
00fa362e
<?php
/**
* Base testcase class for all Doctrine testcases.
*/
class
Doctrine_TestCase
extends
PHPUnit_Framework_TestCase
{
public
function
setUp
()
{
$pdo
=
new
PDO
(
'sqlite::memory:'
);
$this
->
sharedFixture
=
$this
->
loadConnection
(
$pdo
,
'sqlite_memory'
);
}
public
function
loadConnection
(
$conn
,
$name
)
{
return
Doctrine_Manager
::
connection
(
$conn
,
$name
);
}
public
function
loadFixturesPackage
(
$package
,
$models
=
array
())
{
$packagePath
=
'fixtures'
.
DIRECTORY_SEPARATOR
.
$package
;
if
(
!
file_exists
(
$packagePath
))
{
throw
new
Exception
(
'Could not find fixtures package: "'
.
$package
.
'"'
);
}
$modelsPath
=
$packagePath
.
DIRECTORY_SEPARATOR
.
'models'
;
$dataPath
=
$packagePath
.
DIRECTORY_SEPARATOR
.
'data'
;
Doctrine
::
loadModels
(
$modelsPath
);
Doctrine
::
createTablesFromModels
(
$modelsPath
);
$data
=
new
Doctrine_Data
();
$data
->
importData
(
$dataPath
,
'yml'
,
$models
);
}
public
function
tearDown
()
{
Doctrine_Manager
::
getInstance
()
->
getConnection
(
'sqlite_memory'
)
->
close
();
$this
->
sharedFixture
=
NULL
;
}
}
\ No newline at end of file
tests/lib/Doctrine_TestSuite.php
View file @
00fa362e
<?php
/**
* Doctrine's basic test suite implementation. Provides functionality needed by all
* test suites.
*/
class
Doctrine_TestSuite
extends
PHPUnit_Framework_TestSuite
{
}
\ 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