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
e757ccc5
Commit
e757ccc5
authored
Feb 08, 2008
by
jwage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
General dev on tests.
parent
838ccd68
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
74 additions
and
26 deletions
+74
-26
AllTests.php
tests/AllTests.php
+3
-4
AllTests.php
tests/Dbal/AllTests.php
+2
-3
AllTests.php
tests/Dbal/Component/AllTests.php
+2
-3
TestTest.php
tests/Dbal/Component/TestTest.php
+1
-1
AllTests.php
tests/Orm/AllTests.php
+2
-3
AllTests.php
tests/Orm/Component/AllTests.php
+2
-3
TestTest.php
tests/Orm/Component/TestTest.php
+1
-1
1Test.php
tests/Ticket/1Test.php
+1
-1
AllTests.php
tests/Ticket/AllTests.php
+2
-3
CmsUser.yml
tests/fixtures/cms/data/CmsUser.yml
+5
-0
CmsUser.php
tests/fixtures/cms/models/CmsUser.php
+10
-0
DoctrineTestInit.php
tests/lib/DoctrineTestInit.php
+8
-0
Doctrine_TestCase.php
tests/lib/Doctrine_TestCase.php
+35
-2
Doctrine_TestSuite.php
tests/lib/Doctrine_TestSuite.php
+0
-2
No files found.
tests/AllTests.php
View file @
e757ccc5
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
define
(
'PHPUnit_MAIN_METHOD'
,
'AllTests::main'
);
define
(
'PHPUnit_MAIN_METHOD'
,
'AllTests::main'
);
}
}
require_once
'PHPUnit/Framework.php'
;
require_once
'lib/DoctrineTestInit.php'
;
require_once
'PHPUnit/TextUI/TestRunner.php'
;
require_once
'lib/Doctrine_TestSuite.php'
;
// Suites
require_once
'Dbal/AllTests.php'
;
require_once
'Dbal/AllTests.php'
;
require_once
'Orm/AllTests.php'
;
require_once
'Orm/AllTests.php'
;
require_once
'Ticket/AllTests.php'
;
require_once
'Ticket/AllTests.php'
;
...
@@ -20,7 +19,7 @@ class AllTests
...
@@ -20,7 +19,7 @@ class AllTests
public
static
function
suite
()
public
static
function
suite
()
{
{
$suite
=
new
Doctrine_TestSuite
(
'Doctrine'
);
$suite
=
new
Doctrine_TestSuite
(
'Doctrine
Tests
'
);
$suite
->
addTest
(
Dbal_AllTests
::
suite
());
$suite
->
addTest
(
Dbal_AllTests
::
suite
());
$suite
->
addTest
(
Orm_AllTests
::
suite
());
$suite
->
addTest
(
Orm_AllTests
::
suite
());
...
...
tests/Dbal/AllTests.php
View file @
e757ccc5
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
define
(
'PHPUnit_MAIN_METHOD'
,
'Dbal_AllTests::main'
);
define
(
'PHPUnit_MAIN_METHOD'
,
'Dbal_AllTests::main'
);
}
}
require_once
'PHPUnit/Framework.php'
;
require_once
'lib/DoctrineTestInit.php'
;
require_once
'PHPUnit/TextUI/TestRunner.php'
;
require_once
'lib/Doctrine_TestSuite.php'
;
// Suites
require_once
'Dbal/Component/AllTests.php'
;
require_once
'Dbal/Component/AllTests.php'
;
class
Dbal_AllTests
class
Dbal_AllTests
...
...
tests/Dbal/Component/AllTests.php
View file @
e757ccc5
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
define
(
'PHPUnit_MAIN_METHOD'
,
'Dbal_Component_AllTests::main'
);
define
(
'PHPUnit_MAIN_METHOD'
,
'Dbal_Component_AllTests::main'
);
}
}
require_once
'PHPUnit/Framework.php'
;
require_once
'lib/DoctrineTestInit.php'
;
require_once
'PHPUnit/TextUI/TestRunner.php'
;
require_once
'lib/Doctrine_TestSuite.php'
;
// Tests
require_once
'Dbal/Component/TestTest.php'
;
require_once
'Dbal/Component/TestTest.php'
;
class
Dbal_Component_AllTests
class
Dbal_Component_AllTests
...
...
tests/Dbal/Component/TestTest.php
View file @
e757ccc5
<?php
<?php
require_once
'lib/Doctrine
_TestCase
.php'
;
require_once
'lib/Doctrine
TestInit
.php'
;
class
Dbal_Component_TestTest
extends
Doctrine_TestCase
class
Dbal_Component_TestTest
extends
Doctrine_TestCase
{
{
...
...
tests/Orm/AllTests.php
View file @
e757ccc5
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
define
(
'PHPUnit_MAIN_METHOD'
,
'Orm_AllTests::main'
);
define
(
'PHPUnit_MAIN_METHOD'
,
'Orm_AllTests::main'
);
}
}
require_once
'PHPUnit/Framework.php'
;
require_once
'lib/DoctrineTestInit.php'
;
require_once
'PHPUnit/TextUI/TestRunner.php'
;
require_once
'lib/Doctrine_TestSuite.php'
;
// Suites
require_once
'Orm/Component/AllTests.php'
;
require_once
'Orm/Component/AllTests.php'
;
class
Orm_AllTests
class
Orm_AllTests
...
...
tests/Orm/Component/AllTests.php
View file @
e757ccc5
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
define
(
'PHPUnit_MAIN_METHOD'
,
'Dbal_Component_AllTests::main'
);
define
(
'PHPUnit_MAIN_METHOD'
,
'Dbal_Component_AllTests::main'
);
}
}
require_once
'PHPUnit/Framework.php'
;
require_once
'lib/DoctrineTestInit.php'
;
require_once
'PHPUnit/TextUI/TestRunner.php'
;
require_once
'lib/Doctrine_TestSuite.php'
;
// Tests
require_once
'Orm/Component/TestTest.php'
;
require_once
'Orm/Component/TestTest.php'
;
class
Orm_Component_AllTests
class
Orm_Component_AllTests
...
...
tests/Orm/Component/TestTest.php
View file @
e757ccc5
<?php
<?php
require_once
'lib/Doctrine
_TestCase
.php'
;
require_once
'lib/Doctrine
TestInit
.php'
;
class
Orm_Component_TestTest
extends
Doctrine_TestCase
class
Orm_Component_TestTest
extends
Doctrine_TestCase
{
{
...
...
tests/Ticket/1Test.php
View file @
e757ccc5
<?php
<?php
require_once
'lib/Doctrine
_TestCase
.php'
;
require_once
'lib/Doctrine
TestInit
.php'
;
class
Ticket_1Test
extends
Doctrine_TestCase
class
Ticket_1Test
extends
Doctrine_TestCase
{
{
...
...
tests/Ticket/AllTests.php
View file @
e757ccc5
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
...
@@ -3,10 +3,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
define
(
'PHPUnit_MAIN_METHOD'
,
'Ticket_AllTests::main'
);
define
(
'PHPUnit_MAIN_METHOD'
,
'Ticket_AllTests::main'
);
}
}
require_once
'PHPUnit/Framework.php'
;
require_once
'lib/DoctrineTestInit.php'
;
require_once
'PHPUnit/TextUI/TestRunner.php'
;
require_once
'lib/Doctrine_TestSuite.php'
;
// Tests
require_once
'Ticket/1Test.php'
;
require_once
'Ticket/1Test.php'
;
class
Ticket_AllTests
class
Ticket_AllTests
...
...
tests/fixtures/cms/data/CmsUser.yml
0 → 100644
View file @
e757ccc5
---
CmsUser
:
CmsUser_1
:
username
:
jwage
password
:
changeme
\ No newline at end of file
tests/fixtures/cms/models/CmsUser.php
0 → 100644
View file @
e757ccc5
<?php
class
CmsUser
extends
Doctrine_Record
{
public
static
function
initMetadata
(
$class
)
{
$class
->
setColumn
(
'id'
,
'integer'
,
4
,
array
(
'primary'
=>
true
,
'autoincrement'
=>
true
));
$class
->
setColumn
(
'username'
,
'string'
,
255
);
$class
->
setColumn
(
'username'
,
'string'
,
255
);
}
}
\ No newline at end of file
tests/lib/DoctrineTestInit.php
0 → 100644
View file @
e757ccc5
<?php
require_once
'PHPUnit/Framework.php'
;
require_once
'PHPUnit/TextUI/TestRunner.php'
;
require_once
'Doctrine_TestCase.php'
;
require_once
'Doctrine_TestSuite.php'
;
require_once
'../lib/Doctrine.php'
;
spl_autoload_register
(
array
(
'Doctrine'
,
'autoload'
));
\ No newline at end of file
tests/lib/Doctrine_TestCase.php
View file @
e757ccc5
<?php
<?php
require_once
'PHPUnit/Framework.php'
;
class
Doctrine_TestCase
extends
PHPUnit_Framework_TestCase
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 @
e757ccc5
<?php
<?php
require_once
'PHPUnit/Framework.php'
;
class
Doctrine_TestSuite
extends
PHPUnit_Framework_TestSuite
class
Doctrine_TestSuite
extends
PHPUnit_Framework_TestSuite
{
{
...
...
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