Browse Source

More random fixes after inspection.

Daniele Alessandri 10 years ago
parent
commit
dbfc1a74ba
38 changed files with 74 additions and 73 deletions
  1. 4 0
      bin/create-command-test
  2. 2 2
      bin/create-pear
  3. 1 1
      examples/replication_complex.php
  4. 3 0
      src/Client.php
  5. 0 1
      src/Connection/Aggregate/RedisCluster.php
  6. 11 1
      tests/PHPUnit/PredisConnectionTestCase.php
  7. 3 2
      tests/PHPUnit/PredisProfileTestCase.php
  8. 2 2
      tests/Predis/ClientTest.php
  9. 1 1
      tests/Predis/Collection/Iterator/HashKeyTest.php
  10. 1 1
      tests/Predis/Collection/Iterator/KeyspaceTest.php
  11. 2 2
      tests/Predis/Collection/Iterator/ListKeyTest.php
  12. 1 1
      tests/Predis/Collection/Iterator/SetKeyTest.php
  13. 1 1
      tests/Predis/Collection/Iterator/SortedSetKeyTest.php
  14. 0 1
      tests/Predis/Command/KeyPreciseExpireAtTest.php
  15. 5 3
      tests/Predis/Command/KeySortTest.php
  16. 3 5
      tests/Predis/Command/Processor/KeyPrefixProcessorTest.php
  17. 1 1
      tests/Predis/Command/RawCommandTest.php
  18. 0 2
      tests/Predis/Command/ServerEvalSHATest.php
  19. 0 2
      tests/Predis/Command/ServerEvalTest.php
  20. 3 3
      tests/Predis/Command/StringSetBitTest.php
  21. 1 1
      tests/Predis/Command/ZSetIntersectionStoreTest.php
  22. 1 1
      tests/Predis/Command/ZSetUnionStoreTest.php
  23. 1 1
      tests/Predis/CommunicationExceptionTest.php
  24. 0 2
      tests/Predis/Configuration/ConnectionFactoryOptionTest.php
  25. 0 1
      tests/Predis/Connection/Aggregate/PredisClusterTest.php
  26. 2 2
      tests/Predis/Connection/CompositeStreamConnectionTest.php
  27. 4 3
      tests/Predis/Connection/FactoryTest.php
  28. 0 2
      tests/Predis/Connection/ParametersTest.php
  29. 1 1
      tests/Predis/Connection/PhpiredisSocketConnectionTest.php
  30. 1 1
      tests/Predis/Connection/PhpiredisStreamConnectionTest.php
  31. 1 1
      tests/Predis/Connection/StreamConnectionTest.php
  32. 5 4
      tests/Predis/Monitor/ConsumerTest.php
  33. 0 5
      tests/Predis/Pipeline/FireAndForgetTest.php
  34. 1 1
      tests/Predis/Pipeline/PipelineTest.php
  35. 0 2
      tests/Predis/Protocol/Text/CompositeProtocolProcessorTest.php
  36. 7 8
      tests/Predis/PubSub/ConsumerTest.php
  37. 2 2
      tests/Predis/Response/Iterator/MultiBulkTupleTest.php
  38. 3 3
      tests/Predis/Transaction/MultiExecTest.php

+ 4 - 0
bin/create-command-test

@@ -134,7 +134,11 @@ class CommandTestCaseGenerator
             throw new RuntimeException("Class $class must implement Predis\Command\CommandInterface.");
         }
 
+        /*
+         * @var CommandInterface
+         */
         $instance = $reflection->newInstance();
+
         $buffer = $this->getTestCaseBuffer($instance);
 
         return $buffer;

+ 2 - 2
bin/create-pear

@@ -46,12 +46,12 @@ function parseAuthor($string)
 
     if (preg_match('/^\s*(.+?)\s*(?:"(\S+)"\s*)?<(\S+)>\s*$/x', $string , $regs)) {
         if (count($regs) == 4) {
-            list($orig,$name,$user,$email) = $regs;
+            list($_,$name,$user,$email) = $regs;
             $author['name'] = $name;
             $author['user'] = $user;
             $author['email'] = $email;
         } elseif (count($regs) == 3) {
-            list($orig,$name,$email) = $regs;
+            list($_,$name,$email) = $regs;
             $author['name'] = $name;
             $author['email'] = $email;
         }

+ 1 - 1
examples/replication_complex.php

@@ -58,7 +58,7 @@ $options = array(
 
         return $profile;
     },
-    'replication' => function ($options) {
+    'replication' => function () {
         $strategy = new ReplicationStrategy();
         $strategy->setScriptReadOnly(HashMultipleGetAll::BODY);
 

+ 3 - 0
src/Client.php

@@ -417,6 +417,9 @@ class Client implements ClientInterface
             $class = 'Predis\Pipeline\Pipeline';
         }
 
+        /*
+         * @var ClientContextInterface
+         */
         $pipeline = new $class($this);
 
         if (isset($callable)) {

+ 0 - 1
src/Connection/Aggregate/RedisCluster.php

@@ -21,7 +21,6 @@ use Predis\Cluster\RedisStrategy as RedisClusterStrategy;
 use Predis\Command\CommandInterface;
 use Predis\Command\RawCommand;
 use Predis\Connection\NodeConnectionInterface;
-use Predis\Connection\Factory;
 use Predis\Connection\FactoryInterface;
 use Predis\Response\ErrorInterface as ErrorResponseInterface;
 

+ 11 - 1
tests/PHPUnit/PredisConnectionTestCase.php

@@ -116,6 +116,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testExecutesCommandOnServer()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile);
 
         $cmdPing = $this->getMock($profile->getCommandClass('ping'), array('parseResponse'));
@@ -130,6 +131,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testWritesCommandToServer()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile);
 
         $cmdEcho = $this->getMock($profile->getCommandClass('echo'), array('parseResponse'));
@@ -146,6 +148,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsCommandFromServer()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile);
 
         $cmdEcho = $this->getMock($profile->getCommandClass('echo'), array('parseResponse'));
@@ -162,7 +165,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testIsAbleToWriteMultipleCommandsAndReadThemBackForPipelining()
     {
-        $connection = $this->getConnection($profile);
+        $profile = $this->getProfile();
 
         $cmdPing = $this->getMock($profile->getCommandClass('ping'), array('parseResponse'));
         $cmdPing->expects($this->never())
@@ -187,6 +190,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testSendsInitializationCommandsOnConnection()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $cmdPing = $this->getMock($profile->getCommandClass('ping'), array('getArguments'));
@@ -210,6 +214,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsStatusResponses()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->writeRequest($profile->createCommand('set', array('foo', 'bar')));
@@ -229,6 +234,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsBulkResponses()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->executeCommand($profile->createCommand('set', array('foo', 'bar')));
@@ -245,6 +251,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsIntegerResponses()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->executeCommand($profile->createCommand('rpush', array('metavars', 'foo', 'hoge', 'lol')));
@@ -258,6 +265,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsErrorResponsesAsResponseErrorObjects()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->executeCommand($profile->createCommand('set', array('foo', 'bar')));
@@ -272,6 +280,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsMultibulkResponsesAsArrays()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->executeCommand($profile->createCommand('rpush', array('metavars', 'foo', 'hoge', 'lol')));
@@ -299,6 +308,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testThrowsExceptionOnReadWriteTimeout()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true, array('read_write_timeout' => 0.5));
 
         $connection->executeCommand($profile->createCommand('brpop', array('foo', 3)));

+ 3 - 2
tests/PHPUnit/PredisProfileTestCase.php

@@ -12,6 +12,7 @@
 namespace Predis\Profile;
 
 use PredisTestCase;
+use Predis\Command\CommandInterface;
 use Predis\Command\Processor\ProcessorChain;
 
 /**
@@ -248,13 +249,13 @@ abstract class PredisProfileTestCase extends PredisTestCase
         $processor->expects($this->once())
                   ->method('process')
                   ->with($this->isInstanceOf('Predis\Command\CommandInterface'))
-                  ->will($this->returnCallback(function ($cmd) use (&$argsRef) {
+                  ->will($this->returnCallback(function (CommandInterface $cmd) use (&$argsRef) {
                         $cmd->setRawArguments($argsRef = array_map('strtoupper', $cmd->getArguments()));
                     }));
 
         $profile = $this->getProfile();
         $profile->setProcessor($processor);
-        $command = $profile->createCommand('set', array('foo', 'bar'));
+        $profile->createCommand('set', array('foo', 'bar'));
 
         $this->assertSame(array('FOO', 'BAR'), $argsRef);
     }

+ 2 - 2
tests/Predis/ClientTest.php

@@ -226,7 +226,7 @@ class ClientTest extends PredisTestCase
                  ->with($this->isInstanceOf('Predis\Configuration\OptionsInterface'))
                  ->will($this->returnValue($wrongType));
 
-        $client = new Client($callable);
+        new Client($callable);
     }
 
     /**
@@ -308,7 +308,7 @@ class ClientTest extends PredisTestCase
 
         $arg2 = array('aggregate' => function () use ($fnaggregate) { return $fnaggregate; });
 
-        $client = new Client($arg1, $arg2);
+        new Client($arg1, $arg2);
     }
 
     /**

+ 1 - 1
tests/Predis/Collection/Iterator/HashKeyTest.php

@@ -32,7 +32,7 @@ class HashKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::get('2.0')));
 
-        $iterator = new HashKey($client, 'key:hash');
+        new HashKey($client, 'key:hash');
     }
 
     /**

+ 1 - 1
tests/Predis/Collection/Iterator/KeyspaceTest.php

@@ -32,7 +32,7 @@ class KeyspaceTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::get('2.0')));
 
-        $iterator = new Keyspace($client);
+        new Keyspace($client);
     }
 
     /**

+ 2 - 2
tests/Predis/Collection/Iterator/ListKeyTest.php

@@ -120,7 +120,7 @@ class ListKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::getDefault()));
 
-        $iterator = new ListKey($client, 'key:list', 'wrong');
+        new ListKey($client, 'key:list', 'wrong');
     }
 
     /**
@@ -135,7 +135,7 @@ class ListKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::getDefault()));
 
-        $iterator = new ListKey($client, 'key:list', 'wrong');
+        new ListKey($client, 'key:list', 'wrong');
     }
 
     /**

+ 1 - 1
tests/Predis/Collection/Iterator/SetKeyTest.php

@@ -32,7 +32,7 @@ class SetKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::get('2.0')));
 
-        $iterator = new SetKey($client, 'key:set');
+        new SetKey($client, 'key:set');
     }
 
     /**

+ 1 - 1
tests/Predis/Collection/Iterator/SortedSetKeyTest.php

@@ -32,7 +32,7 @@ class SortedSetKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::get('2.0')));
 
-        $iterator = new SortedSetKey($client, 'key:zset');
+        new SortedSetKey($client, 'key:zset');
     }
 
     /**

+ 0 - 1
tests/Predis/Command/KeyPreciseExpireAtTest.php

@@ -85,7 +85,6 @@ class KeyPreciseExpireAtTest extends PredisCommandTestCase
     {
         $redis = $this->getClient();
 
-        $now = time();
         $redis->set('foo', 'bar');
 
         $this->assertTrue($redis->expireat('foo', time() - 100000));

+ 5 - 3
tests/Predis/Command/KeySortTest.php

@@ -11,6 +11,8 @@
 
 namespace Predis\Command;
 
+use Predis\Client;
+
 /**
  * @group commands
  * @group realm-key
@@ -36,11 +38,11 @@ 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  Client $redis Redis client instance.
+     * @param  string $key   Target key
      * @return array
      */
-    protected function lpushUnorderedList(\Predis\Client $redis, $key)
+    protected function lpushUnorderedList(Client $redis, $key)
     {
         $list = array(2, 100, 3, 1, 30, 10);
         $redis->lpush($key, $list);

+ 3 - 5
tests/Predis/Command/Processor/KeyPrefixProcessorTest.php

@@ -67,16 +67,14 @@ class KeyPrefixProcessorTest extends PredisTestCase
      */
     public function testSkipNotPrefixableCommands()
     {
-        $prefix = 'prefix:';
-        $unprefixed = 'key';
-        $expected = "$prefix$unprefixed";
-
         $command = $this->getMock('Predis\Command\CommandInterface');
         $command->expects($this->once())
                 ->method('getId')
                 ->will($this->returnValue('unknown'));
+        $command->expects($this->never())
+                ->method('getArguments');
 
-        $processor = new KeyPrefixProcessor($prefix);
+        $processor = new KeyPrefixProcessor('prefix');
 
         $processor->process($command);
     }

+ 1 - 1
tests/Predis/Command/RawCommandTest.php

@@ -65,7 +65,7 @@ class RawCommandTest extends PredisTestCase
      */
     public function testExceptionOnMissingCommandID()
     {
-        $command = new RawCommand(array());
+        new RawCommand(array());
     }
 
     /**

+ 0 - 2
tests/Predis/Command/ServerEvalSHATest.php

@@ -52,8 +52,6 @@ class ServerEvalSHATest extends PredisCommandTestCase
      */
     public function testParseResponse()
     {
-        $command = $this->getCommand();
-
         $this->assertSame('bar', $this->getCommand()->parseResponse('bar'));
     }
 

+ 0 - 2
tests/Predis/Command/ServerEvalTest.php

@@ -52,8 +52,6 @@ class ServerEvalTest extends PredisCommandTestCase
      */
     public function testParseResponse()
     {
-        $command = $this->getCommand();
-
         $this->assertSame('bar', $this->getCommand()->parseResponse('bar'));
     }
 

+ 3 - 3
tests/Predis/Command/StringSetBitTest.php

@@ -91,7 +91,7 @@ class StringSetBitTest extends PredisCommandTestCase
      */
     public function testThrowsExceptionOnInvalidBitValue()
     {
-        $redis = $this->getClient()->setbit('key:binary', 10, 255);
+        $this->getClient()->setbit('key:binary', 10, 255);
     }
 
     /**
@@ -101,7 +101,7 @@ class StringSetBitTest extends PredisCommandTestCase
      */
     public function testThrowsExceptionOnNegativeOffset()
     {
-        $redis = $this->getClient()->setbit('key:binary', -1, 1);
+        $this->getClient()->setbit('key:binary', -1, 1);
     }
 
     /**
@@ -111,7 +111,7 @@ class StringSetBitTest extends PredisCommandTestCase
      */
     public function testThrowsExceptionOnInvalidOffset()
     {
-        $redis = $this->getClient()->setbit('key:binary', 'invalid', 1);
+        $this->getClient()->setbit('key:binary', 'invalid', 1);
     }
 
     /**

+ 1 - 1
tests/Predis/Command/ZSetIntersectionStoreTest.php

@@ -164,6 +164,6 @@ class ZSetIntersectionStoreTest extends PredisCommandTestCase
         $redis = $this->getClient();
 
         $redis->set('foo', 'bar');
-        $redis->zinterstore('zset:destination', 1, 'foo');
+        $redis->zinterstore('zset:destination', '1', 'foo');
     }
 }

+ 1 - 1
tests/Predis/Command/ZSetUnionStoreTest.php

@@ -182,6 +182,6 @@ class ZSetUnionStoreTest extends PredisCommandTestCase
         $redis = $this->getClient();
 
         $redis->set('foo', 'bar');
-        $redis->zunionstore('zset:destination', 1, 'foo');
+        $redis->zunionstore('zset:destination', '1', 'foo');
     }
 }

+ 1 - 1
tests/Predis/CommunicationExceptionTest.php

@@ -100,7 +100,7 @@ class CommunicationExceptionTest extends PredisTestCase
      * @param  string                             $message    Exception message.
      * @param  int                                $code       Exception code.
      * @param  \Exception                         $inner      Inner exception.
-     * @return \Exception
+     * @return \Predis\CommunicationException
      */
     protected function getException(
         Connection\NodeConnectionInterface $connection,

+ 0 - 2
tests/Predis/Configuration/ConnectionFactoryOptionTest.php

@@ -36,7 +36,6 @@ class ConnectionFactoryOptionTest extends PredisTestCase
      */
     public function testAcceptsNamedArrayWithSchemeToConnectionClassMappings()
     {
-        $option = new ConnectionFactoryOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
 
         $class = get_class($this->getMock('Predis\Connection\NodeConnectionInterface'));
@@ -62,7 +61,6 @@ class ConnectionFactoryOptionTest extends PredisTestCase
      */
     public function testAcceptsConnectionFactoryInstance()
     {
-        $option = new ConnectionFactoryOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
         $value = $this->getMock('Predis\Connection\FactoryInterface');
 

+ 0 - 1
tests/Predis/Connection/Aggregate/PredisClusterTest.php

@@ -89,7 +89,6 @@ class PredisClusterTest extends PredisTestCase
         $connection1 = $this->getMockConnection();
         $connection2 = $this->getMockConnection('tcp://host1:7001?alias=node2');
         $connection3 = $this->getMockConnection('tcp://host1:7002?alias=node3');
-        $connection4 = $this->getMockConnection('tcp://host1:7003?alias=node4');
 
         $cluster = new PredisCluster();
         $cluster->add($connection1);

+ 2 - 2
tests/Predis/Connection/CompositeStreamConnectionTest.php

@@ -39,13 +39,13 @@ class CompositeStreamConnectionTest extends PredisConnectionTestCase
 
     /**
      * @group disconnected
-     * @expectedException InvalidArgumentException
+     * @expectedException \InvalidArgumentException
      * @expectedExceptionMessage Invalid scheme: 'udp'.
      */
     public function testThrowsExceptionOnInvalidScheme()
     {
         $parameters = $this->getParameters(array('scheme' => 'udp'));
-        $connection = new CompositeStreamConnection($parameters);
+        new CompositeStreamConnection($parameters);
     }
 
     /**

+ 4 - 3
tests/Predis/Connection/FactoryTest.php

@@ -52,11 +52,12 @@ class FactoryTest extends PredisTestCase
             'path' => '/tmp/redis.sock',
         ));
 
-        $connection = $factory->create($tcp);
+        $connection = $factory->create($unix);
         $parameters = $connection->getParameters();
         $this->assertInstanceOf('Predis\Connection\StreamConnection', $connection);
-        $this->assertEquals($tcp->scheme, $parameters->scheme);
-        $this->assertEquals($tcp->database, $parameters->database);
+        $this->assertEquals($unix->scheme, $parameters->scheme);
+        $this->assertEquals($unix->path, $parameters->path);
+        $this->assertEquals($unix->database, $parameters->database);
     }
 
     /**

+ 0 - 2
tests/Predis/Connection/ParametersTest.php

@@ -90,8 +90,6 @@ class ParametersTest extends PredisTestCase
      */
     public function testCreateWithUriString()
     {
-        $defaults = $this->getDefaultParametersArray();
-
         $overrides = array(
             'port' => 7000,
             'database' => 5,

+ 1 - 1
tests/Predis/Connection/PhpiredisSocketConnectionTest.php

@@ -45,7 +45,7 @@ class PhpiredisSocketConnectionTest extends PredisConnectionTestCase
     public function testThrowsExceptionOnInvalidScheme()
     {
         $parameters = $this->getParameters(array('scheme' => 'udp'));
-        $connection = new PhpiredisSocketConnection($parameters);
+        new PhpiredisSocketConnection($parameters);
     }
 
     /**

+ 1 - 1
tests/Predis/Connection/PhpiredisStreamConnectionTest.php

@@ -45,7 +45,7 @@ class PhpiredisStreamConnectionTest extends PredisConnectionTestCase
     public function testThrowsExceptionOnInvalidScheme()
     {
         $parameters = $this->getParameters(array('scheme' => 'udp'));
-        $connection = new PhpiredisStreamConnection($parameters);
+        new PhpiredisStreamConnection($parameters);
     }
 
     /**

+ 1 - 1
tests/Predis/Connection/StreamConnectionTest.php

@@ -45,7 +45,7 @@ class StreamConnectionTest extends PredisConnectionTestCase
     public function testThrowsExceptionOnInvalidScheme()
     {
         $parameters = $this->getParameters(array('scheme' => 'udp'));
-        $connection = new StreamConnection($parameters);
+        new StreamConnection($parameters);
     }
 
     /**

+ 5 - 4
tests/Predis/Monitor/ConsumerTest.php

@@ -35,7 +35,8 @@ class ConsumerTest extends PredisTestCase
                 ->will($this->returnValue(false));
 
         $client = new Client(null, array('profile' => $profile));
-        $monitor = new MonitorConsumer($client);
+
+        new MonitorConsumer($client);
     }
 
     /**
@@ -46,9 +47,9 @@ class ConsumerTest extends PredisTestCase
     public function testMonitorConsumerDoesNotWorkOnClusters()
     {
         $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
-
         $client = new Client($cluster);
-        $monitor = new MonitorConsumer($client);
+
+        new MonitorConsumer($client);
     }
 
     /**
@@ -69,7 +70,7 @@ class ConsumerTest extends PredisTestCase
                ->method('executeCommand')
                ->with($cmdMonitor);
 
-        $monitor = new MonitorConsumer($client);
+        new MonitorConsumer($client);
     }
 
     /**

+ 0 - 5
tests/Predis/Pipeline/FireAndForgetTest.php

@@ -13,7 +13,6 @@ namespace Predis\Pipeline;
 
 use PredisTestCase;
 use Predis\Client;
-use Predis\Profile;
 
 /**
  *
@@ -25,8 +24,6 @@ class FireAndForgetTest extends PredisTestCase
      */
     public function testPipelineWithSingleConnection()
     {
-        $profile = Profile\Factory::getDefault();
-
         $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(3))->method('writeRequest');
         $connection->expects($this->never())->method('readResponse');
@@ -45,8 +42,6 @@ class FireAndForgetTest extends PredisTestCase
      */
     public function testSwitchesToMasterWithReplicationConnection()
     {
-        $profile = Profile\Factory::getDefault();
-
         $connection = $this->getMock('Predis\Connection\Aggregate\ReplicationInterface');
         $connection->expects($this->once())
                    ->method('switchTo')

+ 1 - 1
tests/Predis/Pipeline/PipelineTest.php

@@ -346,8 +346,8 @@ class PipelineTest extends PredisTestCase
         try {
             $responses = $pipeline->execute(function ($pipe) {
                 $pipe->echo('one');
-                throw new ClientException('TEST');
                 $pipe->echo('two');
+                throw new ClientException('TEST');
             });
         } catch (Exception $exception) {
             // NOOP

+ 0 - 2
tests/Predis/Protocol/Text/CompositeProtocolProcessorTest.php

@@ -103,8 +103,6 @@ class CompositeProtocolProcessorTest extends PredisTestCase
      */
     public function testConnectionRead()
     {
-        $serialized = "*1\r\n$4\r\nPING\r\n";
-
         $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
         $reader = $this->getMock('Predis\Protocol\ResponseReaderInterface');
 

+ 7 - 8
tests/Predis/PubSub/ConsumerTest.php

@@ -34,7 +34,8 @@ class ConsumerTest extends PredisTestCase
                 ->will($this->returnValue(false));
 
         $client = new Client(null, array('profile' => $profile));
-        $pubsub = new PubSubConsumer($client);
+
+        new PubSubConsumer($client);
     }
 
     /**
@@ -45,9 +46,9 @@ class ConsumerTest extends PredisTestCase
     public function testPubSubConsumerDoesNotWorkOnClusters()
     {
         $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
-
         $client = new Client($cluster);
-        $pubsub = new PubSubConsumer($client);
+
+        new PubSubConsumer($client);
     }
 
     /**
@@ -60,7 +61,7 @@ class ConsumerTest extends PredisTestCase
         $client = $this->getMock('Predis\Client', array('executeCommand'), array($connection));
         $client->expects($this->never())->method('executeCommand');
 
-        $pubsub = new PubSubConsumer($client);
+        new PubSubConsumer($client);
     }
 
     /**
@@ -70,9 +71,6 @@ class ConsumerTest extends PredisTestCase
     {
         $profile = Profile\Factory::get(REDIS_SERVER_VERSION);
 
-        $cmdSubscribe = $profile->createCommand('subscribe', array('channel:foo'));
-        $cmdPsubscribe = $profile->createCommand('psubscribe', array('channels:*'));
-
         $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(2))->method('writeRequest');
 
@@ -85,7 +83,8 @@ class ConsumerTest extends PredisTestCase
                }));
 
         $options = array('subscribe' => 'channel:foo', 'psubscribe' => 'channels:*');
-        $pubsub = new PubSubConsumer($client, $options);
+
+        new PubSubConsumer($client, $options);
     }
 
     /**

+ 2 - 2
tests/Predis/Response/Iterator/MultiBulkTupleTest.php

@@ -56,7 +56,7 @@ class MultiBulkTupleTest extends PredisTestCase
         $client = $this->getClient();
         $client->zadd('metavars', 1, 'foo', 2, 'hoge', 3, 'lol');
 
-        $iterator = new MultiBulkTuple($client->zrange('metavars', 0, -1, 'withscores'));
+        $iterator = new MultiBulkTuple($client->zrange('metavars', '0', '-1', 'withscores'));
 
         $this->assertInstanceOf('OuterIterator', $iterator);
         $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkTuple', $iterator);
@@ -87,7 +87,7 @@ class MultiBulkTupleTest extends PredisTestCase
         $client = $this->getClient();
         $client->zadd('metavars', 1, 'foo', 2, 'hoge', 3, 'lol');
 
-        $iterator = new MultiBulkTuple($client->zrange('metavars', 0, -1, 'withscores'));
+        $iterator = new MultiBulkTuple($client->zrange('metavars', '0', '-1', 'withscores'));
 
         unset($iterator);
 

+ 3 - 3
tests/Predis/Transaction/MultiExecTest.php

@@ -37,7 +37,7 @@ class MultiExecTest extends PredisTestCase
         $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $client = new Client($connection, array('profile' => $profile));
 
-        $tx = new MultiExec($client);
+        new MultiExec($client);
     }
 
     /**
@@ -386,7 +386,7 @@ class MultiExecTest extends PredisTestCase
         $tx = $this->getMockedTransaction($callback, $options);
 
         $tx->execute(function ($tx) {
-            $bar = $tx->get('foo');
+            $tx->get('foo');
             $tx->set('hoge', 'piyo');
         });
 
@@ -450,7 +450,7 @@ class MultiExecTest extends PredisTestCase
         $callback = $this->getExecuteCallback();
         $tx = $this->getMockedTransaction($callback);
 
-        $responses = $tx->execute(function ($tx) {
+        $tx->execute(function ($tx) {
             $tx->echo('!!ABORT!!');
         });
     }