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
b3afff26
Commit
b3afff26
authored
May 24, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
775e861f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
SnapshotTestCase.php
tests/Collection/SnapshotTestCase.php
+11
-0
unsolved.php
tests/unsolved.php
+40
-0
No files found.
tests/Collection/SnapshotTestCase.php
View file @
b3afff26
...
...
@@ -98,5 +98,16 @@ class Doctrine_Collection_Snapshot_TestCase extends Doctrine_UnitTestCase
$this
->
assertEqual
(
$users
[
0
]
->
Group
[
0
]
->
name
,
'PHP'
);
$this
->
assertEqual
(
$users
[
0
]
->
Group
[
1
]
->
name
,
'Web'
);
unset
(
$user
->
Group
[
0
]);
$user
->
save
();
$this
->
assertEqual
(
count
(
$user
->
Group
->
getSnapshot
()),
1
);
unset
(
$user
->
Group
[
1
]);
$this
->
assertEqual
(
count
(
$user
->
Group
->
getSnapshot
()),
1
);
$user
->
save
();
$this
->
assertEqual
(
count
(
$user
->
Group
->
getSnapshot
()),
0
);
}
}
tests/unsolved.php
0 → 100644
View file @
b3afff26
<?php
require_once
dirname
(
__FILE__
)
.
'/../lib/Doctrine.php'
;
error_reporting
(
E_ALL
);
spl_autoload_register
(
array
(
'Doctrine'
,
'autoload'
));
require_once
'classes.php'
;
require_once
dirname
(
__FILE__
)
.
'/../models/location.php'
;
$manager
=
Doctrine_Manager
::
getInstance
();
$dbh
=
Doctrine_Db
::
getConnection
(
'sqlite::memory:'
);
$conn
=
$manager
->
openConnection
(
$dbh
);
$user
=
new
User
();
$user
->
name
=
'zYne'
;
$user
->
Phonenumber
[
0
]
->
phonenumber
=
'123 123'
;
if
(
$user
===
$user
->
Phonenumber
[
0
]
->
entity_id
)
{
print
'case 1 works'
;
}
$city
=
new
Record_City
();
$city
->
name
=
'City 1'
;
$city
->
District
->
name
=
'District 1'
;
if
(
$city
->
District
===
$city
->
district_id
)
{
print
'case 2 works'
;
}
$c
=
new
Record_Country
();
$c
->
name
=
'Some country'
;
$c
->
City
[
0
]
->
name
=
'City 1'
;
$c
->
City
[
0
]
->
District
->
name
=
'District 1'
;
print
$c
->
City
[
0
]
->
District
;
print
$c
->
City
[
0
]
->
get
(
'district_id'
);
if
(
$c
->
City
[
0
]
->
get
(
'district_id'
)
==
$c
->
City
[
0
]
->
District
)
{
print
"case 3 works!"
;
}
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