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
8a21c170
Unverified
Commit
8a21c170
authored
Aug 24, 2017
by
Kim Hemsø Rasmussen
Committed by
Marco Pivetta
Aug 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unnecessary assertions and method arguments.
Fixed cs issues
parent
bc101552
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
ConnectionTest.php
tests/Doctrine/Tests/DBAL/ConnectionTest.php
+10
-13
No files found.
tests/Doctrine/Tests/DBAL/ConnectionTest.php
View file @
8a21c170
...
@@ -778,7 +778,10 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
...
@@ -778,7 +778,10 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
);
);
}
}
public
function
testShouldNotPassPlatformInParamsToTheQueryCacheProfileInExecuteCacheQuery
()
/**
* @group DBAL-2821
*/
public
function
testShouldNotPassPlatformInParamsToTheQueryCacheProfileInExecuteCacheQuery
()
:
void
{
{
$resultCacheDriverMock
=
$this
->
createMock
(
Cache
::
class
);
$resultCacheDriverMock
=
$this
->
createMock
(
Cache
::
class
);
...
@@ -788,10 +791,6 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
...
@@ -788,10 +791,6 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
->
with
(
'cacheKey'
)
->
with
(
'cacheKey'
)
->
will
(
$this
->
returnValue
([
'realKey'
=>
[]]));
->
will
(
$this
->
returnValue
([
'realKey'
=>
[]]));
$query
=
'SELECT * FROM foo WHERE bar = ?'
;
$params
=
[
666
];
$types
=
[
\PDO
::
PARAM_INT
];
/* @var $queryCacheProfileMock QueryCacheProfile|\PHPUnit_Framework_MockObject_MockObject */
/* @var $queryCacheProfileMock QueryCacheProfile|\PHPUnit_Framework_MockObject_MockObject */
$queryCacheProfileMock
=
$this
->
createMock
(
QueryCacheProfile
::
class
);
$queryCacheProfileMock
=
$this
->
createMock
(
QueryCacheProfile
::
class
);
...
@@ -800,25 +799,23 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
...
@@ -800,25 +799,23 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
->
method
(
'getResultCacheDriver'
)
->
method
(
'getResultCacheDriver'
)
->
will
(
$this
->
returnValue
(
$resultCacheDriverMock
));
->
will
(
$this
->
returnValue
(
$resultCacheDriverMock
));
$connectionParams
=
$this
->
params
;
$query
=
'SELECT 1'
;
$expectedParams
=
$connectionParams
;
$connectionParams
[
"platform"
]
=
$this
->
createMock
(
AbstractPlatform
::
class
)
;
$connectionParams
=
$this
->
params
;
// This is our main expectation
// This is our main expectation
$queryCacheProfileMock
$queryCacheProfileMock
->
expects
(
$this
->
once
())
->
expects
(
$this
->
once
())
->
method
(
'generateCacheKeys'
)
->
method
(
'generateCacheKeys'
)
->
with
(
$query
,
$params
,
$types
,
$expected
Params
)
->
with
(
$query
,
[],
[],
$connection
Params
)
->
will
(
$this
->
returnValue
([
'cacheKey'
,
'realKey'
]));
->
will
(
$this
->
returnValue
([
'cacheKey'
,
'realKey'
]));
$connectionParams
[
'platform'
]
=
$this
->
createMock
(
AbstractPlatform
::
class
);
/* @var $driver Driver */
/* @var $driver Driver */
$driver
=
$this
->
createMock
(
Driver
::
class
);
$driver
=
$this
->
createMock
(
Driver
::
class
);
$this
->
assertInstanceOf
(
(
new
Connection
(
$connectionParams
,
$driver
))
->
executeCacheQuery
(
$query
,
[],
[],
$queryCacheProfileMock
);
ArrayStatement
::
class
,
(
new
Connection
(
$connectionParams
,
$driver
))
->
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