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
34a8acba
Commit
34a8acba
authored
Oct 17, 2006
by
pookey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding a test to show a situation where cascading inserts do not work
parent
5cbc3fc8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
2 deletions
+65
-2
UnsortedTestCase.php
tests/UnsortedTestCase.php
+29
-0
classes.php
tests/classes.php
+32
-2
run.php
tests/run.php
+4
-0
No files found.
tests/UnsortedTestCase.php
0 → 100644
View file @
34a8acba
<?php
/**
* Tests in this file are unsorted, and should be placed in an appropriate
* test file. If you are unsure where to put a unit test, place them in here
* and hopefully someone else will move them.
*/
class
Doctrine_UnsortedTestCase
extends
Doctrine_UnitTestCase
{
public
function
testCascadingInsert
()
{
$package
=
new
Package
();
$package
->
description
=
'Package'
;
$packageverison
=
new
PackageVersion
();
$packageverison
->
description
=
'Version'
;
$packageverisonnotes
=
new
PackageVersionNotes
();
$packageverisonnotes
->
description
=
'Notes'
;
$package
->
Version
[
0
]
=
$packageverison
;
$package
->
Version
[
0
]
->
Note
[
0
]
=
$packageverisonnotes
;
$package
->
save
();
$this
->
assertNotNull
(
$package
->
id
);
$this
->
assertNotNull
(
$package
->
Version
[
0
]
->
id
);
$this
->
assertNotNull
(
$package
->
Version
[
0
]
->
Note
[
0
]
->
id
);
}
}
tests/classes.php
View file @
34a8acba
...
@@ -68,7 +68,6 @@ class Group extends Entity {
...
@@ -68,7 +68,6 @@ class Group extends Entity {
parent
::
setUp
();
parent
::
setUp
();
$this
->
hasMany
(
"User"
,
"Groupuser.user_id"
);
$this
->
hasMany
(
"User"
,
"Groupuser.user_id"
);
$this
->
setInheritanceMap
(
array
(
"type"
=>
1
));
$this
->
setInheritanceMap
(
array
(
"type"
=>
1
));
}
}
}
}
class
Error
extends
Doctrine_Record
{
class
Error
extends
Doctrine_Record
{
...
@@ -558,5 +557,36 @@ class BoardWithPosition extends Doctrine_Record {
...
@@ -558,5 +557,36 @@ class BoardWithPosition extends Doctrine_Record {
$this
->
hasOne
(
"CategoryWithPosition as Category"
,
"BoardWithPosition.category_id"
);
$this
->
hasOne
(
"CategoryWithPosition as Category"
,
"BoardWithPosition.category_id"
);
}
}
}
}
class
Package
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'description'
,
'string'
,
255
);
}
public
function
setUp
()
{
$this
->
ownsMany
(
'PackageVersion as Version'
,
'PackageVersion.package_id'
);
}
}
class
PackageVersion
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'package_id'
,
'integer'
);
$this
->
hasColumn
(
'description'
,
'string'
,
255
);
}
public
function
setUp
()
{
$this
->
hasOne
(
'Package'
,
'PackageVersion.package_id'
);
$this
->
hasMany
(
'PackageVersionNotes as Note'
,
'PackageVersionNotes.package_version_id'
);
}
}
class
PackageVersionNotes
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'package_version_id'
,
'integer'
);
$this
->
hasColumn
(
'description'
,
'string'
,
255
);
}
public
function
setUp
()
{
$this
->
hasOne
(
'PackageVersion'
,
'PackageVersionNotes.package_version_id'
);
}
}
?>
?>
tests/run.php
View file @
34a8acba
...
@@ -49,6 +49,9 @@ require_once("RelationTestCase.php");
...
@@ -49,6 +49,9 @@ require_once("RelationTestCase.php");
require_once
(
"DataDictSqliteTestCase.php"
);
require_once
(
"DataDictSqliteTestCase.php"
);
require_once
(
"CustomResultSetOrderTestCase.php"
);
require_once
(
"CustomResultSetOrderTestCase.php"
);
// unsorted tests are here, these should be moved somewhere sensible
require_once
(
"UnsortedTestCase.php"
);
error_reporting
(
E_ALL
);
error_reporting
(
E_ALL
);
print
"<pre>"
;
print
"<pre>"
;
...
@@ -132,6 +135,7 @@ $test->addTestCase(new Doctrine_Query_From_TestCase());
...
@@ -132,6 +135,7 @@ $test->addTestCase(new Doctrine_Query_From_TestCase());
$test
->
addTestCase
(
new
Doctrine_Query_Select_TestCase
());
$test
->
addTestCase
(
new
Doctrine_Query_Select_TestCase
());
$test
->
addTestCase
(
new
Doctrine_UnsortedTestCase
());
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());
...
...
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