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
c23d80a1
Commit
c23d80a1
authored
May 03, 2017
by
Marco Pivetta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CS (alignment, short array syntax), inlining useless variable
parent
db1395b7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
ConnectionTest.php
tests/Doctrine/Tests/DBAL/ConnectionTest.php
+15
-12
No files found.
tests/Doctrine/Tests/DBAL/ConnectionTest.php
View file @
c23d80a1
...
@@ -11,6 +11,7 @@ use Doctrine\DBAL\Driver;
...
@@ -11,6 +11,7 @@ use Doctrine\DBAL\Driver;
use
Doctrine\DBAL\Events
;
use
Doctrine\DBAL\Events
;
use
Doctrine\Tests\Mocks\DriverConnectionMock
;
use
Doctrine\Tests\Mocks\DriverConnectionMock
;
use
Doctrine\Tests\Mocks\DriverMock
;
use
Doctrine\Tests\Mocks\DriverMock
;
use
Doctrine\DBAL\Cache\ArrayStatement
;
class
ConnectionTest
extends
\Doctrine\Tests\DbalTestCase
class
ConnectionTest
extends
\Doctrine\Tests\DbalTestCase
{
{
...
@@ -678,35 +679,37 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
...
@@ -678,35 +679,37 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
{
{
$resultCacheDriverMock
=
$this
->
createMock
(
Cache
::
class
);
$resultCacheDriverMock
=
$this
->
createMock
(
Cache
::
class
);
$resultCacheDriverMock
->
expects
(
$this
->
atLeastOnce
())
$resultCacheDriverMock
->
expects
(
$this
->
atLeastOnce
())
->
method
(
'fetch'
)
->
method
(
'fetch'
)
->
with
(
'cacheKey'
)
->
with
(
'cacheKey'
)
->
will
(
$this
->
returnValue
(
array
(
'realKey'
=>
array
())
));
->
will
(
$this
->
returnValue
(
[
'realKey'
=>
[]]
));
$query
=
'SELECT * FROM foo WHERE bar = ?'
;
$query
=
'SELECT * FROM foo WHERE bar = ?'
;
$params
=
array
(
666
)
;
$params
=
[
666
]
;
$types
=
array
(
\PDO
::
PARAM_INT
)
;
$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
);
$queryCacheProfileMock
->
expects
(
$this
->
any
())
$queryCacheProfileMock
->
expects
(
$this
->
any
())
->
method
(
'getResultCacheDriver'
)
->
method
(
'getResultCacheDriver'
)
->
will
(
$this
->
returnValue
(
$resultCacheDriverMock
));
->
will
(
$this
->
returnValue
(
$resultCacheDriverMock
));
// This is our main expectation
// This is our main expectation
$queryCacheProfileMock
->
expects
(
$this
->
once
())
$queryCacheProfileMock
->
expects
(
$this
->
once
())
->
method
(
'generateCacheKeys'
)
->
method
(
'generateCacheKeys'
)
->
with
(
$query
,
$params
,
$types
,
$this
->
params
)
->
with
(
$query
,
$params
,
$types
,
$this
->
params
)
->
will
(
$this
->
returnValue
(
array
(
'cacheKey'
,
'realKey'
)
));
->
will
(
$this
->
returnValue
(
[
'cacheKey'
,
'realKey'
]
));
/* @var $driver Driver */
/* @var $driver Driver */
$driver
=
$this
->
createMock
(
Driver
::
class
);
$driver
=
$this
->
createMock
(
Driver
::
class
);
$conn
=
new
Connection
(
$this
->
params
,
$driver
);
$this
->
assertInstanceOf
(
ArrayStatement
::
class
,
$this
->
assertInstanceOf
(
'Doctrine\DBAL\Cache\ArrayStatement'
,
(
new
Connection
(
$this
->
params
,
$driver
))
->
executeCacheQuery
(
$query
,
$params
,
$types
,
$queryCacheProfileMock
)
$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