From 2a6409590c5a61b08b28fc9f0a3115532bac1045 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Tue, 17 Dec 2013 12:55:56 +0100 Subject: [PATCH] Run php-cs against test suite. --- .../PHPUnit/ArrayHasSameValuesConstraint.php | 2 +- tests/PHPUnit/PredisCommandTestCase.php | 8 ++--- tests/PHPUnit/PredisConnectionTestCase.php | 8 ++--- tests/PHPUnit/PredisDistributorTestCase.php | 8 ++--- tests/PHPUnit/PredisProfileTestCase.php | 6 ++-- tests/PHPUnit/PredisTestCase.php | 34 +++++++++---------- tests/PHPUnit/RedisCommandConstraint.php | 2 +- tests/Predis/ClientTest.php | 2 +- tests/Predis/Cluster/PredisStrategyTest.php | 2 +- tests/Predis/Cluster/RedisStrategyTest.php | 2 +- tests/Predis/Command/KeySortTest.php | 4 +-- .../Processor/KeyPrefixProcessorTest.php | 2 +- tests/Predis/Command/ScriptCommandTest.php | 1 - tests/Predis/Command/ZSetScanTest.php | 8 ++--- tests/Predis/CommunicationExceptionTest.php | 12 +++---- .../Configuration/ClusterOptionTest.php | 1 - tests/Predis/Connection/FactoryTest.php | 1 - .../Connection/MasterSlaveReplicationTest.php | 3 +- tests/Predis/Connection/ParametersTest.php | 2 +- tests/Predis/Connection/PredisClusterTest.php | 2 +- tests/Predis/Connection/RedisClusterTest.php | 3 +- .../Connection/WebdisConnectionTest.php | 2 +- tests/Predis/Pipeline/AtomicTest.php | 1 - tests/Predis/Pipeline/FireAndForgetTest.php | 1 - tests/Predis/Pipeline/PipelineTest.php | 4 +-- tests/Predis/Profile/FactoryTest.php | 1 - .../Protocol/Text/ProtocolProcessorTest.php | 1 - .../Replication/ReplicationStrategyTest.php | 4 +-- tests/Predis/Transaction/MultiExecTest.php | 16 +++++---- 29 files changed, 68 insertions(+), 75 deletions(-) diff --git a/tests/PHPUnit/ArrayHasSameValuesConstraint.php b/tests/PHPUnit/ArrayHasSameValuesConstraint.php index 8bd25e79..13035bb6 100644 --- a/tests/PHPUnit/ArrayHasSameValuesConstraint.php +++ b/tests/PHPUnit/ArrayHasSameValuesConstraint.php @@ -55,4 +55,4 @@ class ArrayHasSameValuesConstraint extends PHPUnit_Framework_Constraint { return $this->toString(); } -} \ No newline at end of file +} diff --git a/tests/PHPUnit/PredisCommandTestCase.php b/tests/PHPUnit/PredisCommandTestCase.php index 3017aaa2..56e9bf59 100644 --- a/tests/PHPUnit/PredisCommandTestCase.php +++ b/tests/PHPUnit/PredisCommandTestCase.php @@ -25,14 +25,14 @@ abstract class PredisCommandTestCase extends PredisTestCase * * @return CommandInterface|string Instance or FQN of the expected command. */ - protected abstract function getExpectedCommand(); + abstract protected function getExpectedCommand(); /** * Returns the expected command ID. * * @return string */ - protected abstract function getExpectedId(); + abstract protected function getExpectedId(); /** * Returns a new command instance. @@ -49,7 +49,7 @@ abstract class PredisCommandTestCase extends PredisTestCase /** * Returns a new client instance. * - * @param bool $connect Flush selected database before returning the client. + * @param bool $connect Flush selected database before returning the client. * @return Client */ public function getClient($flushdb = true) @@ -91,7 +91,7 @@ abstract class PredisCommandTestCase extends PredisTestCase /** * Returns a new command instance with the specified arguments. * - * @param array $arguments Arguments for the command. + * @param array $arguments Arguments for the command. * @return CommandInterface */ protected function getCommandWithArgumentsArray(array $arguments) diff --git a/tests/PHPUnit/PredisConnectionTestCase.php b/tests/PHPUnit/PredisConnectionTestCase.php index 85efcae0..2b3187e8 100644 --- a/tests/PHPUnit/PredisConnectionTestCase.php +++ b/tests/PHPUnit/PredisConnectionTestCase.php @@ -326,10 +326,10 @@ abstract class PredisConnectionTestCase extends PredisTestCase /** * Returns a new instance of a connection instance. * - * @param Profile\ProfileInterface $profile Reference to the server profile instance. - * @param Boolean $initialize Push default initialization commands (SELECT and FLUSHDB). - * @param array $parameters Additional connection parameters. + * @param Profile\ProfileInterface $profile Reference to the server profile instance. + * @param Boolean $initialize Push default initialization commands (SELECT and FLUSHDB). + * @param array $parameters Additional connection parameters. * @return StreamConnection */ - protected abstract function getConnection(&$profile = null, $initialize = false, array $parameters = array()); + abstract protected function getConnection(&$profile = null, $initialize = false, array $parameters = array()); } diff --git a/tests/PHPUnit/PredisDistributorTestCase.php b/tests/PHPUnit/PredisDistributorTestCase.php index 3e95a4c8..ed56dc0a 100644 --- a/tests/PHPUnit/PredisDistributorTestCase.php +++ b/tests/PHPUnit/PredisDistributorTestCase.php @@ -23,14 +23,14 @@ abstract class PredisDistributorTestCase extends PredisTestCase * * @return Predis\Cluster\Distributor\DistributorInterface */ - protected abstract function getDistributorInstance(); + abstract protected function getDistributorInstance(); /** * Returns a list of nodes from the hashring. * - * @param DistributorInterface $ring Hashring instance. - * @param int $iterations Number of nodes to fetch. - * @return array Nodes from the hashring. + * @param DistributorInterface $ring Hashring instance. + * @param int $iterations Number of nodes to fetch. + * @return array Nodes from the hashring. */ protected function getNodes(DistributorInterface $ring, $iterations = 10) { diff --git a/tests/PHPUnit/PredisProfileTestCase.php b/tests/PHPUnit/PredisProfileTestCase.php index e0fbb409..644edd71 100644 --- a/tests/PHPUnit/PredisProfileTestCase.php +++ b/tests/PHPUnit/PredisProfileTestCase.php @@ -34,20 +34,20 @@ abstract class PredisProfileTestCase extends PredisTestCase * * @return string Version string. */ - protected abstract function getExpectedVersion(); + abstract protected function getExpectedVersion(); /** * Returns the expected list of commands supported by the tested profile. * * @return array List of supported commands. */ - protected abstract function getExpectedCommands(); + abstract protected function getExpectedCommands(); /** * Returns the list of commands supported by the current * server profile. * - * @param ProfileInterface $profile Server profile instance. + * @param ProfileInterface $profile Server profile instance. * @return array */ protected function getCommands(ProfileInterface $profile) diff --git a/tests/PHPUnit/PredisTestCase.php b/tests/PHPUnit/PredisTestCase.php index bd4ed5e8..abf5973c 100644 --- a/tests/PHPUnit/PredisTestCase.php +++ b/tests/PHPUnit/PredisTestCase.php @@ -23,8 +23,8 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase * Verifies that a Redis command is a valid Predis\Command\CommandInterface * instance with the specified ID and command arguments. * - * @param string|CommandInterface $command Expected command or command ID. - * @param array $arguments Expected command arguments. + * @param string|CommandInterface $command Expected command or command ID. + * @param array $arguments Expected command arguments. */ public function isRedisCommand($command = null, array $arguments = null) { @@ -38,7 +38,7 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase * instance for $expected. * * @param array|string|CommandInterface $expected Expected command. - * @param mixed $actual Actual command. + * @param mixed $actual Actual command. */ public function assertRedisCommand($expected, $actual) { @@ -56,7 +56,7 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase * Asserts that two arrays have the same values, even if with different order. * * @param array $expected Expected array. - * @param array $actual Actual array. + * @param array $actual Actual array. */ public function assertSameValues(array $expected, array $actual) { @@ -94,7 +94,7 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase * Returns a named array with the default connection parameters merged with * the specified additional parameters. * - * @param array $additional Additional connection parameters. + * @param array $additional Additional connection parameters. * @return array Connection parameters. */ protected function getParametersArray(array $additional) @@ -105,7 +105,7 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase /** * Returns a new instance of connection parameters. * - * @param array $additional Additional connection parameters. + * @param array $additional Additional connection parameters. * @return Connection\Parameters Default connection parameters. */ protected function getParameters($additional = array()) @@ -119,7 +119,7 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase /** * Returns a new instance of server profile. * - * @param array $additional Additional connection parameters. + * @param array $additional Additional connection parameters. * @return Profile\ProfileInterface */ protected function getProfile($version = null) @@ -130,7 +130,7 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase /** * Returns a new client instance. * - * @param bool $connect Flush selected database before returning the client. + * @param bool $connect Flush selected database before returning the client. * @return Client */ protected function createClient(array $parameters = null, array $options = null, $flushdb = true) @@ -158,8 +158,8 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase } /** - * @param string $expectedVersion Expected redis version - * @param string $operator Comparison operator. + * @param string $expectedVersion Expected redis version + * @param string $operator Comparison operator. * @throws \PHPUnit_Framework_SkippedTestError when expected redis version is not met */ protected function executeOnRedisVersion($expectedVersion, $operator, $callback) @@ -170,7 +170,7 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase if (isset($info['server']['redis_version'])) { // Redis >= 2.6 $version = $info['server']['redis_version']; - } else if (isset($info['redis_version'])) { + } elseif (isset($info['redis_version'])) { // Redis < 2.6 $version = $info['redis_version']; } else { @@ -187,8 +187,8 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase } /** - * @param string $expectedVersion Expected redis version - * @param string $operator Comparison operator. + * @param string $expectedVersion Expected redis version + * @param string $operator Comparison operator. * @throws \PHPUnit_Framework_SkippedTestError when expected redis version is not met */ protected function executeOnProfileVersion($expectedVersion, $operator, $callback) @@ -204,10 +204,10 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase } /** - * @param string $expectedVersion Expected redis version. - * @param string $message Optional message. - * @param bool $remote Based on local profile or remote redis version. - * @throws RuntimeException when unable to retrieve server info or redis version + * @param string $expectedVersion Expected redis version. + * @param string $message Optional message. + * @param bool $remote Based on local profile or remote redis version. + * @throws RuntimeException when unable to retrieve server info or redis version * @throws \PHPUnit_Framework_SkippedTestError when expected redis version is not met */ public function markTestSkippedOnRedisVersionBelow($expectedVersion, $message = '', $remote = true) diff --git a/tests/PHPUnit/RedisCommandConstraint.php b/tests/PHPUnit/RedisCommandConstraint.php index df83e040..9253d0b5 100644 --- a/tests/PHPUnit/RedisCommandConstraint.php +++ b/tests/PHPUnit/RedisCommandConstraint.php @@ -94,4 +94,4 @@ class RedisCommandConstraint extends PHPUnit_Framework_Constraint return "$string {$this->toString()}"; } -} \ No newline at end of file +} diff --git a/tests/Predis/ClientTest.php b/tests/Predis/ClientTest.php index 9643709e..7046ac48 100644 --- a/tests/Predis/ClientTest.php +++ b/tests/Predis/ClientTest.php @@ -826,7 +826,7 @@ class ClientTest extends PredisTestCase /** * Returns an URI string representation of the specified connection parameters. * - * @param array $parameters Array of connection parameters. + * @param array $parameters Array of connection parameters. * @return String URI string. */ protected function getParametersString(array $parameters) diff --git a/tests/Predis/Cluster/PredisStrategyTest.php b/tests/Predis/Cluster/PredisStrategyTest.php index 7f3fc3e7..a3c5d64d 100644 --- a/tests/Predis/Cluster/PredisStrategyTest.php +++ b/tests/Predis/Cluster/PredisStrategyTest.php @@ -243,7 +243,7 @@ class PredisStrategyTest extends PredisTestCase /** * Returns the list of expected supported commands. * - * @param string $type Optional type of command (based on its keys) + * @param string $type Optional type of command (based on its keys) * @return array */ protected function getExpectedCommands($type = null) diff --git a/tests/Predis/Cluster/RedisStrategyTest.php b/tests/Predis/Cluster/RedisStrategyTest.php index 134c4b7f..45101a66 100644 --- a/tests/Predis/Cluster/RedisStrategyTest.php +++ b/tests/Predis/Cluster/RedisStrategyTest.php @@ -250,7 +250,7 @@ class RedisStrategyTest extends PredisTestCase /** * Returns the list of expected supported commands. * - * @param string $type Optional type of command (based on its keys) + * @param string $type Optional type of command (based on its keys) * @return array */ protected function getExpectedCommands($type = null) diff --git a/tests/Predis/Command/KeySortTest.php b/tests/Predis/Command/KeySortTest.php index c6778ec2..5470081d 100644 --- a/tests/Predis/Command/KeySortTest.php +++ b/tests/Predis/Command/KeySortTest.php @@ -36,8 +36,8 @@ class KeySortTest extends PredisCommandTestCase /** * Utility method to to an LPUSH of some unordered values on a key. * - * @param Predis\Client $redis Redis client instance. - * @param string $key Target key + * @param Predis\Client $redis Redis client instance. + * @param string $key Target key * @return array */ protected function lpushUnorderedList(Predis\Client $redis, $key) diff --git a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php index a139245c..d9d0aa49 100644 --- a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php +++ b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php @@ -330,7 +330,7 @@ class KeyPrefixProcessorTest extends PredisTestCase /** * Data provider for key prefixing test. * - * @return array + * @return array */ public function commandArgumentsDataProvider() { diff --git a/tests/Predis/Command/ScriptCommandTest.php b/tests/Predis/Command/ScriptCommandTest.php index afeda493..dc6995f0 100644 --- a/tests/Predis/Command/ScriptCommandTest.php +++ b/tests/Predis/Command/ScriptCommandTest.php @@ -37,7 +37,6 @@ class ScriptCommandTest extends PredisTestCase ->will($this->returnValue(2)); $command->setArguments($arguments); - $this->assertSame(array_merge(array(self::LUA_SCRIPT_SHA1, 2), $arguments), $command->getArguments()); } diff --git a/tests/Predis/Command/ZSetScanTest.php b/tests/Predis/Command/ZSetScanTest.php index 4a1430ed..172ba4ed 100644 --- a/tests/Predis/Command/ZSetScanTest.php +++ b/tests/Predis/Command/ZSetScanTest.php @@ -102,8 +102,8 @@ class ZSetScanTest extends PredisCommandTestCase $response = $redis->zscan('key', 0); $this->assertSame(0, $response[0]); - $this->assertSame($expectedMembers, array_map(function($e) { return $e[0]; }, $response[1])); - $this->assertSame($expectedScores, array_map(function($e) { return $e[1]; }, $response[1])); + $this->assertSame($expectedMembers, array_map(function ($e) { return $e[0]; }, $response[1])); + $this->assertSame($expectedScores, array_map(function ($e) { return $e[1]; }, $response[1])); } /** @@ -116,8 +116,8 @@ class ZSetScanTest extends PredisCommandTestCase $response = $redis->zscan('key', 0, 'MATCH', 'member:t*'); - $this->assertSame(array('member:two', 'member:three'), array_map(function($e) { return $e[0]; }, $response[1])); - $this->assertSame(array(2.0, 3.0), array_map(function($e) { return $e[1]; }, $response[1])); + $this->assertSame(array('member:two', 'member:three'), array_map(function ($e) { return $e[0]; }, $response[1])); + $this->assertSame(array(2.0, 3.0), array_map(function ($e) { return $e[1]; }, $response[1])); } /** diff --git a/tests/Predis/CommunicationExceptionTest.php b/tests/Predis/CommunicationExceptionTest.php index 6e65bcc7..5d9425e7 100644 --- a/tests/Predis/CommunicationExceptionTest.php +++ b/tests/Predis/CommunicationExceptionTest.php @@ -78,7 +78,7 @@ class CommunicationExceptionTest extends PredisTestCase /** * Returns a mocked connection instance. * - * @param mixed $parameters Connection parameters. + * @param mixed $parameters Connection parameters. * @return Connection\SingleConnectionInterface */ protected function getMockedConnectionBase($parameters = null) @@ -87,7 +87,7 @@ class CommunicationExceptionTest extends PredisTestCase if ($parameters === null) { $builder->disableOriginalConstructor(); - } else if (!$parameters instanceof Connection\ParametersInterface) { + } elseif (!$parameters instanceof Connection\ParametersInterface) { $parameters = new Connection\Parameters($parameters); } @@ -97,10 +97,10 @@ class CommunicationExceptionTest extends PredisTestCase /** * Returns a connection exception instance. * - * @param Connection\SingleConnectionInterface $message Connection instance. - * @param string $message Exception message. - * @param int $code Exception code. - * @param \Exception $inner Inner exception. + * @param Connection\SingleConnectionInterface $message Connection instance. + * @param string $message Exception message. + * @param int $code Exception code. + * @param \Exception $inner Inner exception. * @return \Exception */ protected function getException( diff --git a/tests/Predis/Configuration/ClusterOptionTest.php b/tests/Predis/Configuration/ClusterOptionTest.php index 2a7f95c0..7f5c4671 100644 --- a/tests/Predis/Configuration/ClusterOptionTest.php +++ b/tests/Predis/Configuration/ClusterOptionTest.php @@ -11,7 +11,6 @@ namespace Predis\Configuration; -use stdClass; use PredisTestCase; /** diff --git a/tests/Predis/Connection/FactoryTest.php b/tests/Predis/Connection/FactoryTest.php index 3748796f..8e65f8c7 100644 --- a/tests/Predis/Connection/FactoryTest.php +++ b/tests/Predis/Connection/FactoryTest.php @@ -47,7 +47,6 @@ class FactoryTest extends PredisTestCase $this->assertEquals($tcp->host, $parameters->host); $this->assertEquals($tcp->database, $parameters->database); - $unix = new Parameters(array( 'scheme' => 'unix', 'path' => '/tmp/redis.sock', diff --git a/tests/Predis/Connection/MasterSlaveReplicationTest.php b/tests/Predis/Connection/MasterSlaveReplicationTest.php index 201f2d58..c1a40e72 100644 --- a/tests/Predis/Connection/MasterSlaveReplicationTest.php +++ b/tests/Predis/Connection/MasterSlaveReplicationTest.php @@ -495,6 +495,7 @@ class MasterSlaveReplicationTest extends PredisTestCase $replication->getReplicationStrategy()->setCommandReadOnly('exists', function ($cmd) { list($arg1) = $cmd->getArguments(); + return $arg1 === 'foo'; }); @@ -568,7 +569,7 @@ class MasterSlaveReplicationTest extends PredisTestCase /** * Returns a base mocked connection from Predis\Connection\SingleConnectionInterface. * - * @param mixed $parameters Optional parameters. + * @param mixed $parameters Optional parameters. * @return mixed */ protected function getMockConnection($parameters = null) diff --git a/tests/Predis/Connection/ParametersTest.php b/tests/Predis/Connection/ParametersTest.php index 1bd6e181..7f179771 100644 --- a/tests/Predis/Connection/ParametersTest.php +++ b/tests/Predis/Connection/ParametersTest.php @@ -254,7 +254,7 @@ class ParametersTest extends PredisTestCase /** * Returns an URI string representation of the specified connection parameters. * - * @param array $parameters array of connection parameters. + * @param array $parameters array of connection parameters. * @return String URI string. */ protected function getParametersString(array $parameters) diff --git a/tests/Predis/Connection/PredisClusterTest.php b/tests/Predis/Connection/PredisClusterTest.php index 2c2e5cf5..e3030af9 100644 --- a/tests/Predis/Connection/PredisClusterTest.php +++ b/tests/Predis/Connection/PredisClusterTest.php @@ -380,7 +380,7 @@ class PredisClusterTest extends PredisTestCase /** * Returns a base mocked connection from Predis\Connection\SingleConnectionInterface. * - * @param mixed $parameters Optional parameters. + * @param mixed $parameters Optional parameters. * @return mixed */ protected function getMockConnection($parameters = null) diff --git a/tests/Predis/Connection/RedisClusterTest.php b/tests/Predis/Connection/RedisClusterTest.php index 7f7de11f..2e36d9b8 100644 --- a/tests/Predis/Connection/RedisClusterTest.php +++ b/tests/Predis/Connection/RedisClusterTest.php @@ -548,7 +548,6 @@ class RedisClusterTest extends PredisTestCase ->with($command) ->will($this->onConsecutiveCalls('foobar', 'foobar')); - $factory = $this->getMock('Predis\Connection\Factory'); $factory->expects($this->never())->method('create'); @@ -644,7 +643,7 @@ class RedisClusterTest extends PredisTestCase /** * Returns a base mocked connection from Predis\Connection\SingleConnectionInterface. * - * @param mixed $parameters Optional parameters. + * @param mixed $parameters Optional parameters. * @return mixed */ protected function getMockConnection($parameters = null) diff --git a/tests/Predis/Connection/WebdisConnectionTest.php b/tests/Predis/Connection/WebdisConnectionTest.php index 1ef9926f..b1b54b26 100644 --- a/tests/Predis/Connection/WebdisConnectionTest.php +++ b/tests/Predis/Connection/WebdisConnectionTest.php @@ -171,7 +171,7 @@ class WebdisConnectionTest extends PredisTestCase /** * Returns a new instance of a connection instance. * - * @param array $parameters Additional connection parameters. + * @param array $parameters Additional connection parameters. * @return WebdisConnection */ protected function getConnection(&$profile = null, array $parameters = array()) diff --git a/tests/Predis/Pipeline/AtomicTest.php b/tests/Predis/Pipeline/AtomicTest.php index 4af9d1fc..9bedd3d6 100644 --- a/tests/Predis/Pipeline/AtomicTest.php +++ b/tests/Predis/Pipeline/AtomicTest.php @@ -12,7 +12,6 @@ namespace Predis\Pipeline; use PredisTestCase; -use SplQueue; use Predis\Client; use Predis\Response; diff --git a/tests/Predis/Pipeline/FireAndForgetTest.php b/tests/Predis/Pipeline/FireAndForgetTest.php index e65895ae..b8e3222f 100644 --- a/tests/Predis/Pipeline/FireAndForgetTest.php +++ b/tests/Predis/Pipeline/FireAndForgetTest.php @@ -11,7 +11,6 @@ namespace Predis\Pipeline; -use SplQueue; use PredisTestCase; use Predis\Client; use Predis\Profile; diff --git a/tests/Predis/Pipeline/PipelineTest.php b/tests/Predis/Pipeline/PipelineTest.php index b6cfb1cd..d4bec351 100644 --- a/tests/Predis/Pipeline/PipelineTest.php +++ b/tests/Predis/Pipeline/PipelineTest.php @@ -468,8 +468,8 @@ class PipelineTest extends PredisTestCase * Returns a client instance connected to the specified Redis * server instance to perform integration tests. * - * @return array Additional connection parameters. - * @return array Additional client options. + * @return array Additional connection parameters. + * @return array Additional client options. * @return Client New client instance. */ protected function getClient(array $parameters = array(), array $options = array()) diff --git a/tests/Predis/Profile/FactoryTest.php b/tests/Predis/Profile/FactoryTest.php index b828346a..741a1a38 100644 --- a/tests/Predis/Profile/FactoryTest.php +++ b/tests/Predis/Profile/FactoryTest.php @@ -12,7 +12,6 @@ namespace Predis\Profile; use PredisTestCase; -use Predis\Command\Processor\ProcessorChain; /** * diff --git a/tests/Predis/Protocol/Text/ProtocolProcessorTest.php b/tests/Predis/Protocol/Text/ProtocolProcessorTest.php index 34ca800d..457bc4ec 100644 --- a/tests/Predis/Protocol/Text/ProtocolProcessorTest.php +++ b/tests/Predis/Protocol/Text/ProtocolProcessorTest.php @@ -36,7 +36,6 @@ class ProtocolProcessorTest extends PredisTestCase ->method('getArguments') ->will($this->returnValue(array())); - $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface'); $connection->expects($this->once()) diff --git a/tests/Predis/Replication/ReplicationStrategyTest.php b/tests/Predis/Replication/ReplicationStrategyTest.php index 58ec2321..a9aa435b 100644 --- a/tests/Predis/Replication/ReplicationStrategyTest.php +++ b/tests/Predis/Replication/ReplicationStrategyTest.php @@ -118,7 +118,6 @@ class ReplicationStrategyTest extends PredisTestCase ->method('getId') ->will($this->returnValue('CMDTEST')); - $strategy->setCommandReadOnly('CMDTEST', true); $this->assertTrue($strategy->isReadOperation($command)); } @@ -135,7 +134,6 @@ class ReplicationStrategyTest extends PredisTestCase ->method('getId') ->will($this->returnValue('CMDTEST')); - $strategy->setCommandReadOnly('CMDTEST', false); $this->assertFalse($strategy->isReadOperation($command)); @@ -235,7 +233,7 @@ class ReplicationStrategyTest extends PredisTestCase /** * Returns the list of expected supported commands. * - * @param string $type Optional type of command (based on its keys) + * @param string $type Optional type of command (based on its keys) * @return array */ protected function getExpectedCommands($type = null) diff --git a/tests/Predis/Transaction/MultiExecTest.php b/tests/Predis/Transaction/MultiExecTest.php index 9d841a33..dcf37ad2 100644 --- a/tests/Predis/Transaction/MultiExecTest.php +++ b/tests/Predis/Transaction/MultiExecTest.php @@ -730,7 +730,7 @@ class MultiExecTest extends PredisTestCase * Returns a mocked instance of Predis\Connection\SingleConnectionInterface * using the specified callback to return values from executeCommand(). * - * @param \Closure $executeCallback + * @param \Closure $executeCallback * @return \Predis\Connection\SingleConnectionInterface */ protected function getMockedConnection($executeCallback) @@ -748,7 +748,7 @@ class MultiExecTest extends PredisTestCase * the specified callback to return values from the executeCommand method * of the underlying connection. * - * @param \Closure $executeCallback + * @param \Closure $executeCallback * @return MultiExec */ protected function getMockedTransaction($executeCallback, $txOpts = null, $clientOpts = null) @@ -763,8 +763,8 @@ class MultiExecTest extends PredisTestCase /** * Returns a callback that emulates a server-side MULTI/EXEC transaction context. * - * @param array $expected Expected responses. - * @param array $commands Reference to an array that stores the whole flow of commands. + * @param array $expected Expected responses. + * @param array $commands Reference to an array that stores the whole flow of commands. * @return \Closure */ protected function getExecuteCallback($expected = array(), &$commands = array(), &$cas = array()) @@ -805,6 +805,7 @@ class MultiExecTest extends PredisTestCase if ($abort) { $commands = $cas = array(); $abort = false; + return null; } @@ -844,11 +845,12 @@ class MultiExecTest extends PredisTestCase * Converts an array of instances of Predis\Command\CommandInterface and * returns an array containing their IDs. * - * @param array $commands List of commands instances. + * @param array $commands List of commands instances. * @return array */ - protected static function commandsToIDs($commands) { - return array_map(function($cmd) { return $cmd->getId(); }, $commands); + protected static function commandsToIDs($commands) + { + return array_map(function ($cmd) { return $cmd->getId(); }, $commands); } /**