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
5e4b1a20
Commit
5e4b1a20
authored
Apr 10, 2012
by
Aigars Gedroics
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-249] Created test for column fetch type.
parent
74c25001
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
ResultCacheTest.php
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
+11
-2
No files found.
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
View file @
5e4b1a20
...
...
@@ -65,6 +65,15 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
$this
->
assertCacheNonCacheSelectSameFetchModeAreEqual
(
$expectedResult
,
\PDO
::
FETCH_BOTH
);
}
public
function
testFetchColumn
()
{
$expectedResult
=
array
();
foreach
(
$this
->
expectedResult
AS
$v
)
{
$expectedResult
[]
=
array_shift
(
$v
);
}
$this
->
assertCacheNonCacheSelectSameFetchModeAreEqual
(
$expectedResult
,
\PDO
::
FETCH_COLUMN
);
}
public
function
testMixingFetch
()
{
...
...
@@ -180,7 +189,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
{
$data
=
array
();
while
(
$row
=
$stmt
->
fetch
(
$fetchStyle
))
{
$data
[]
=
array_change_key_case
(
$row
,
CASE_LOWER
)
;
$data
[]
=
is_array
(
$row
)
?
array_change_key_case
(
$row
,
CASE_LOWER
)
:
$row
;
}
$stmt
->
closeCursor
();
return
$data
;
...
...
@@ -191,7 +200,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
$data
=
array
();
$stmt
->
setFetchMode
(
$fetchStyle
);
foreach
(
$stmt
as
$row
)
{
$data
[]
=
array_change_key_case
(
$row
,
CASE_LOWER
)
;
$data
[]
=
is_array
(
$row
)
?
array_change_key_case
(
$row
,
CASE_LOWER
)
:
$row
;
}
$stmt
->
closeCursor
();
return
$data
;
...
...
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