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
b276574e
Commit
b276574e
authored
Dec 09, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-171] Added coverage.
parent
3a39bea9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
BasicFunctionalTest.php
tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php
+34
-0
No files found.
tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php
View file @
b276574e
...
...
@@ -544,6 +544,40 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
assertEquals
(
"Lorem ipsum dolor sunt. And stuff!"
,
$articleNew
->
text
);
}
public
function
testFlushDoesNotIssueUnnecessaryUpdates
()
{
$user
=
new
CmsUser
;
$user
->
name
=
'Guilherme'
;
$user
->
username
=
'gblanco'
;
$user
->
status
=
'developer'
;
$address
=
new
CmsAddress
;
$address
->
country
=
'Germany'
;
$address
->
city
=
'Berlin'
;
$address
->
zip
=
'12345'
;
$address
->
user
=
$user
;
$user
->
address
=
$address
;
$this
->
_em
->
persist
(
$user
);
$this
->
_em
->
flush
();
$this
->
_em
->
clear
();
$query
=
$this
->
_em
->
createQuery
(
'select u, a from Doctrine\Tests\Models\CMS\CmsUser u join u.address a'
);
$user2
=
$query
->
getSingleResult
();
$oldLogger
=
$this
->
_em
->
getConnection
()
->
getConfiguration
()
->
getSqlLogger
();
$debugStack
=
new
\Doctrine\DBAL\Logging\DebugStack
;
$this
->
_em
->
getConnection
()
->
getConfiguration
()
->
setSqlLogger
(
$debugStack
);
$this
->
_em
->
flush
();
$this
->
assertEquals
(
0
,
count
(
$debugStack
->
queries
));
$this
->
_em
->
getConnection
()
->
getConfiguration
()
->
setSqlLogger
(
$oldLogger
);
}
//DRAFT OF EXPECTED/DESIRED BEHAVIOR
/*public function testPersistentCollectionContainsDoesNeverInitialize()
{
...
...
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