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
e374d994
Commit
e374d994
authored
Nov 10, 2014
by
Antonio Vilar
Committed by
Marco Pivetta
May 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some test tweaks
parent
d19567bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
QueryCacheProfile.php
lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
+1
-1
QueryCacheProfileTest.php
tests/Doctrine/Tests/DBAL/Cache/QueryCacheProfileTest.php
+7
-3
ConnectionTest.php
tests/Doctrine/Tests/DBAL/ConnectionTest.php
+5
-4
No files found.
lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
View file @
e374d994
...
...
@@ -97,7 +97,7 @@ class QueryCacheProfile
*
* @return array
*/
public
function
generateCacheKeys
(
$query
,
$params
,
$types
,
$connectionParams
=
array
())
public
function
generateCacheKeys
(
$query
,
$params
,
$types
,
array
$connectionParams
=
array
())
{
$realCacheKey
=
'query='
.
$query
.
'¶ms='
.
serialize
(
$params
)
.
...
...
tests/Doctrine/Tests/DBAL/Cache/QueryCacheProfileTest.php
View file @
e374d994
...
...
@@ -2,8 +2,6 @@
namespace
Doctrine\Tests\DBAL\Cache
;
require_once
__DIR__
.
'/../../TestInit.php'
;
use
Doctrine\DBAL\Cache\QueryCacheProfile
;
use
Doctrine\Tests\DbalTestCase
;
...
...
@@ -41,7 +39,7 @@ class QueryCacheProfileTest extends DbalTestCase
$connectionParams
);
$this
->
assertEquals
(
self
::
CACHE_KEY
,
$generatedKeys
[
0
],
'The returned cache
d
key should match the given one'
);
$this
->
assertEquals
(
self
::
CACHE_KEY
,
$generatedKeys
[
0
],
'The returned cache key should match the given one'
);
}
public
function
testShouldGenerateAnAutomaticKeyIfNoKeyHasBeenGiven
()
...
...
@@ -67,6 +65,12 @@ class QueryCacheProfileTest extends DbalTestCase
$connectionParams
);
$this
->
assertNotEquals
(
self
::
CACHE_KEY
,
$generatedKeys
[
0
],
'The returned cache key should be generated automatically'
);
$this
->
assertNotEmpty
(
$generatedKeys
[
0
],
'The generated cache key should not be empty'
);
}
...
...
tests/Doctrine/Tests/DBAL/ConnectionTest.php
View file @
e374d994
...
...
@@ -675,8 +675,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
{
$resultCacheDriverMock
=
$this
->
getMock
(
'Doctrine\Common\Cache\Cache'
);
$resultCacheDriverMock
->
expects
(
$this
->
a
ny
())
$resultCacheDriverMock
->
expects
(
$this
->
a
tLeastOnce
())
->
method
(
'fetch'
)
->
with
(
'cacheKey'
)
->
will
(
$this
->
returnValue
(
array
(
'realKey'
=>
array
())));
$query
=
'SELECT * FROM foo WHERE bar = ?'
;
...
...
@@ -700,8 +701,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
$this
->
getMock
(
'Doctrine\DBAL\Driver'
)
);
$
result
=
$conn
->
executeCacheQuery
(
$query
,
$params
,
$types
,
$queryCacheProfileMock
);
$this
->
assertInstanceOf
(
'Doctrine\DBAL\Cache\ArrayStatement'
,
$result
);
$
this
->
assertInstanceOf
(
'Doctrine\DBAL\Cache\ArrayStatement'
,
$conn
->
executeCacheQuery
(
$query
,
$params
,
$types
,
$queryCacheProfileMock
)
);
}
}
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