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
83317282
Commit
83317282
authored
Sep 19, 2007
by
gnat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the test to not break other tests.
parent
174b507d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
+19
-9
gnatEmail.php
models/gnatEmail.php
+10
-0
gnatUser.php
models/gnatUser.php
+2
-2
OneToOneTestCase.php
tests/Relation/OneToOneTestCase.php
+7
-7
No files found.
models/gnatEmail.php
0 → 100644
View file @
83317282
<?php
class
gnatEmail
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'address'
,
'string'
,
150
);
}
}
models/gnatUser.php
View file @
83317282
...
...
@@ -7,13 +7,13 @@ class gnatUser extends Doctrine_Record
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'name'
,
'string'
,
150
);
$this
->
hasColumn
(
'
email
_id'
,
'integer'
,
10
,
array
(
'unique'
=>
true
,));
$this
->
hasColumn
(
'
foreign
_id'
,
'integer'
,
10
,
array
(
'unique'
=>
true
,));
}
public
function
setUp
()
{
parent
::
setUp
();
$this
->
ownsOne
(
'
Email'
,
array
(
'local'
=>
'email
_id'
,
'foreign'
=>
'id'
,
'onDelete'
=>
'CASCADE'
));
$this
->
ownsOne
(
'
gnatEmail as Email'
,
array
(
'local'
=>
'foreign
_id'
,
'foreign'
=>
'id'
,
'onDelete'
=>
'CASCADE'
));
}
}
...
...
tests/Relation/OneToOneTestCase.php
View file @
83317282
...
...
@@ -36,7 +36,7 @@ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
{
}
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'gnatUser'
,
'Email'
,
'Entity'
,
'Record_City'
,
'Record_Country'
,
'SelfRefTest'
);
$this
->
tables
=
array
(
'gnatUser'
,
'
gnatEmail'
,
'
Email'
,
'Entity'
,
'Record_City'
,
'Record_Country'
,
'SelfRefTest'
);
parent
::
prepareTables
();
}
...
...
@@ -90,14 +90,14 @@ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
{
$user
=
new
gnatUser
();
$user
->
name
=
"test"
;
$email
=
new
Email
();
$email
->
address
=
"test@test.com"
;
$email
=
new
gnat
Email
();
$email
->
address
=
"test
3
@test.com"
;
$user
->
Email
=
$email
;
$user
->
save
();
$this
->
assertTrue
(
$user
->
Email
instanceOf
Email
);
$this
->
assertTrue
(
$user
->
email
_id
!=
0
);
$this
->
assertTrue
(
$user
->
email
_id
!=
null
);
$this
->
assertTrue
(
$user
->
email
_id
==
$user
->
Email
->
id
);
$this
->
assertTrue
(
$user
->
Email
instanceOf
gnat
Email
);
$this
->
assertTrue
(
$user
->
foreign
_id
!=
0
);
$this
->
assertTrue
(
$user
->
foreign
_id
!=
null
);
$this
->
assertTrue
(
$user
->
foreign
_id
==
$user
->
Email
->
id
);
}
}
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