Skip to content

Commit

Permalink
PHPCBF
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Sep 28, 2018
1 parent f18ced5 commit 73bd82a
Show file tree
Hide file tree
Showing 180 changed files with 6,406 additions and 6,249 deletions.
46 changes: 18 additions & 28 deletions tests/Doctrine/Tests/DBAL/Cache/QueryCacheProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,26 @@ class QueryCacheProfileTest extends DbalTestCase
private const LIFETIME = 3600;
private const CACHE_KEY = 'user_specified_cache_key';

/**
* @var QueryCacheProfile
*/
/** @var QueryCacheProfile */
private $queryCacheProfile;

/**
* @var string
*/
/** @var string */
private $query = 'SELECT * FROM foo WHERE bar = ?';

/**
* @var int[]
*/
/** @var int[] */
private $params = [666];

/**
* @var string[]
*/
/** @var string[] */
private $types = [ParameterType::INTEGER];

/**
* @var string[]
*/
/** @var string[] */
private $connectionParams = [
'dbname' => 'database_name',
'user' => 'database_user',
'password' => 'database_password',
'host' => 'database_host',
'driver' => 'database_driver',
];
'dbname' => 'database_name',
'user' => 'database_user',
'password' => 'database_password',
'host' => 'database_host',
'driver' => 'database_driver',
];

protected function setUp()
{
Expand All @@ -50,7 +40,7 @@ protected function setUp()

public function testShouldUseTheGivenCacheKeyIfPresent()
{
list($cacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$cacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -64,7 +54,7 @@ public function testShouldGenerateAnAutomaticKeyIfNoKeyHasBeenGiven()
{
$this->queryCacheProfile = $this->queryCacheProfile->setCacheKey(null);

list($cacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$cacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -84,7 +74,7 @@ public function testShouldGenerateDifferentKeysForSameQueryAndParamsAndDifferent
{
$this->queryCacheProfile = $this->queryCacheProfile->setCacheKey(null);

list($firstCacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$firstCacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -93,7 +83,7 @@ public function testShouldGenerateDifferentKeysForSameQueryAndParamsAndDifferent

$this->connectionParams['host'] = 'a_different_host';

list($secondCacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$secondCacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -107,7 +97,7 @@ public function testConnectionParamsShouldBeHashed()
{
$this->queryCacheProfile = $this->queryCacheProfile->setCacheKey(null);

list($cacheKey, $queryString) = $this->queryCacheProfile->generateCacheKeys(
[$cacheKey, $queryString] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -128,14 +118,14 @@ public function testShouldGenerateSameKeysIfNoneOfTheParamsChanges()
{
$this->queryCacheProfile = $this->queryCacheProfile->setCacheKey(null);

list($firstCacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$firstCacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
$this->connectionParams
);

list($secondCacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$secondCacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand Down
4 changes: 1 addition & 3 deletions tests/Doctrine/Tests/DBAL/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@

/**
* Unit tests for the configuration container.
*
* @author Steve Müller <st.mueller@dzh-online.de>
*/
class ConfigurationTest extends DbalTestCase
{
/**
* The configuration container instance under test.
*
* @var \Doctrine\DBAL\Configuration
* @var Configuration
*/
protected $config;

Expand Down
Loading

0 comments on commit 73bd82a

Please sign in to comment.