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
c19af342
Commit
c19af342
authored
Oct 27, 2016
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-2546] Ported tests from #2487 and #2489
parent
27728621
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
StatementTest.php
tests/Doctrine/Tests/DBAL/Functional/StatementTest.php
+41
-0
No files found.
tests/Doctrine/Tests/DBAL/Functional/StatementTest.php
View file @
c19af342
...
...
@@ -132,4 +132,45 @@ EOF
);
$this
->
assertSame
(
$contents
,
stream_get_contents
(
$stream
));
}
public
function
testIncompletelyFetchedStatementDoesNotBlockConnection
()
{
$table
=
new
Table
(
'stmt_test_non_fetched'
);
$table
->
addColumn
(
'id'
,
'integer'
);
$this
->
_conn
->
getSchemaManager
()
->
createTable
(
$table
);
$this
->
_conn
->
insert
(
'stmt_test_non_fetched'
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
'stmt_test_non_fetched'
,
array
(
'id'
=>
2
));
$stmt1
=
$this
->
_conn
->
prepare
(
'SELECT id FROM stmt_test_non_fetched'
);
$stmt1
->
execute
();
$stmt1
->
fetch
();
$stmt1
->
execute
();
// fetching only one record out of two
$stmt1
->
fetch
();
$stmt2
=
$this
->
_conn
->
prepare
(
'SELECT id FROM stmt_test_non_fetched WHERE id = ?'
);
$stmt2
->
execute
(
array
(
1
));
$this
->
assertEquals
(
1
,
$stmt2
->
fetchColumn
());
}
public
function
testReuseStatementAfterClosingCursor
()
{
$table
=
new
Table
(
'stmt_test_close_cursor'
);
$table
->
addColumn
(
'id'
,
'integer'
);
$this
->
_conn
->
getSchemaManager
()
->
createTable
(
$table
);
$this
->
_conn
->
insert
(
'stmt_test_close_cursor'
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
'stmt_test_close_cursor'
,
array
(
'id'
=>
2
));
$stmt
=
$this
->
_conn
->
prepare
(
'SELECT id FROM stmt_test_close_cursor WHERE id = ?'
);
$stmt
->
execute
(
array
(
1
));
$id
=
$stmt
->
fetchColumn
();
$this
->
assertEquals
(
1
,
$id
);
$stmt
->
closeCursor
();
$stmt
->
execute
(
array
(
2
));
$id
=
$stmt
->
fetchColumn
();
$this
->
assertEquals
(
2
,
$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