Эх сурвалжийг харах

[tests] Improve the basic framework of our test suite.

We now have a base test case class for Predis (namely PredisTestCase)
grouping various commonly used utility methods shared by all of the
tests in the suite, greatly improving reusability.
Daniele Alessandri 11 жил өмнө
parent
commit
b253bdc41e
100 өөрчлөгдсөн 309 нэмэгдсэн , 409 устгасан
  1. 0 2
      bin/generate-command-test.php
  2. 13 6
      tests/PHPUnit/ArrayHasSameValuesConstraint.php
  3. 8 118
      tests/PHPUnit/CommandTestCase.php
  4. 2 28
      tests/PHPUnit/ConnectionTestCase.php
  5. 2 2
      tests/PHPUnit/DistributorTestCase.php
  6. 232 0
      tests/PHPUnit/PredisTestCase.php
  7. 22 20
      tests/PHPUnit/RedisProfileTestCase.php
  8. 2 2
      tests/Predis/ClientExceptionTest.php
  9. 2 42
      tests/Predis/ClientTest.php
  10. 2 2
      tests/Predis/Cluster/Distributor/EmptyRingExceptionTest.php
  11. 2 3
      tests/Predis/Cluster/PredisStrategyTest.php
  12. 2 3
      tests/Predis/Cluster/RedisStrategyTest.php
  13. 2 3
      tests/Predis/Collection/Iterator/HashKeyTest.php
  14. 2 3
      tests/Predis/Collection/Iterator/KeyspaceTest.php
  15. 2 3
      tests/Predis/Collection/Iterator/ListKeyTest.php
  16. 2 3
      tests/Predis/Collection/Iterator/SetKeyTest.php
  17. 2 3
      tests/Predis/Collection/Iterator/SortedSetKeyTest.php
  18. 2 2
      tests/Predis/Command/CommandTest.php
  19. 0 2
      tests/Predis/Command/ConnectionAuthTest.php
  20. 0 2
      tests/Predis/Command/ConnectionEchoTest.php
  21. 0 2
      tests/Predis/Command/ConnectionPingTest.php
  22. 0 2
      tests/Predis/Command/ConnectionQuitTest.php
  23. 0 2
      tests/Predis/Command/ConnectionSelectTest.php
  24. 0 2
      tests/Predis/Command/HashDeleteTest.php
  25. 0 2
      tests/Predis/Command/HashExistsTest.php
  26. 0 2
      tests/Predis/Command/HashGetAllTest.php
  27. 0 2
      tests/Predis/Command/HashGetMultipleTest.php
  28. 0 2
      tests/Predis/Command/HashGetTest.php
  29. 0 2
      tests/Predis/Command/HashIncrementByFloatTest.php
  30. 0 2
      tests/Predis/Command/HashIncrementByTest.php
  31. 0 2
      tests/Predis/Command/HashKeysTest.php
  32. 0 2
      tests/Predis/Command/HashLengthTest.php
  33. 0 2
      tests/Predis/Command/HashScanTest.php
  34. 0 2
      tests/Predis/Command/HashSetMultipleTest.php
  35. 0 2
      tests/Predis/Command/HashSetPreserveTest.php
  36. 0 2
      tests/Predis/Command/HashSetTest.php
  37. 0 2
      tests/Predis/Command/HashValuesTest.php
  38. 0 2
      tests/Predis/Command/KeyDeleteTest.php
  39. 0 2
      tests/Predis/Command/KeyDumpTest.php
  40. 0 2
      tests/Predis/Command/KeyExistsTest.php
  41. 0 2
      tests/Predis/Command/KeyExpireAtTest.php
  42. 0 2
      tests/Predis/Command/KeyExpireTest.php
  43. 0 2
      tests/Predis/Command/KeyKeysTest.php
  44. 0 2
      tests/Predis/Command/KeyKeysV12xTest.php
  45. 0 2
      tests/Predis/Command/KeyMoveTest.php
  46. 0 2
      tests/Predis/Command/KeyPersistTest.php
  47. 0 2
      tests/Predis/Command/KeyPreciseExpireAtTest.php
  48. 0 2
      tests/Predis/Command/KeyPreciseExpireTest.php
  49. 0 2
      tests/Predis/Command/KeyPreciseTimeToLiveTest.php
  50. 0 2
      tests/Predis/Command/KeyRandomTest.php
  51. 0 2
      tests/Predis/Command/KeyRenamePreserveTest.php
  52. 0 2
      tests/Predis/Command/KeyRenameTest.php
  53. 0 2
      tests/Predis/Command/KeyRestoreTest.php
  54. 0 2
      tests/Predis/Command/KeyScanTest.php
  55. 0 2
      tests/Predis/Command/KeySortTest.php
  56. 0 2
      tests/Predis/Command/KeyTimeToLiveTest.php
  57. 0 2
      tests/Predis/Command/KeyTypeTest.php
  58. 0 2
      tests/Predis/Command/ListIndexTest.php
  59. 0 2
      tests/Predis/Command/ListInsertTest.php
  60. 0 2
      tests/Predis/Command/ListLengthTest.php
  61. 0 2
      tests/Predis/Command/ListPopFirstBlockingTest.php
  62. 0 2
      tests/Predis/Command/ListPopFirstTest.php
  63. 0 2
      tests/Predis/Command/ListPopLastBlockingTest.php
  64. 0 2
      tests/Predis/Command/ListPopLastPushHeadBlockingTest.php
  65. 0 2
      tests/Predis/Command/ListPopLastPushHeadTest.php
  66. 0 2
      tests/Predis/Command/ListPopLastTest.php
  67. 0 2
      tests/Predis/Command/ListPushHeadTest.php
  68. 0 2
      tests/Predis/Command/ListPushHeadXTest.php
  69. 0 2
      tests/Predis/Command/ListPushTailTest.php
  70. 0 2
      tests/Predis/Command/ListPushTailXTest.php
  71. 0 2
      tests/Predis/Command/ListRangeTest.php
  72. 0 2
      tests/Predis/Command/ListRemoveTest.php
  73. 0 2
      tests/Predis/Command/ListSetTest.php
  74. 0 2
      tests/Predis/Command/ListTrimTest.php
  75. 2 2
      tests/Predis/Command/Processor/KeyPrefixProcessorTest.php
  76. 2 2
      tests/Predis/Command/Processor/ProcessorChainTest.php
  77. 0 2
      tests/Predis/Command/PubSubPublishTest.php
  78. 0 2
      tests/Predis/Command/PubSubPubsubTest.php
  79. 0 2
      tests/Predis/Command/PubSubSubscribeByPatternTest.php
  80. 0 2
      tests/Predis/Command/PubSubSubscribeTest.php
  81. 0 2
      tests/Predis/Command/PubSubUnsubscribeByPatternTest.php
  82. 0 2
      tests/Predis/Command/PubSubUnsubscribeTest.php
  83. 2 2
      tests/Predis/Command/RawCommandTest.php
  84. 2 2
      tests/Predis/Command/ScriptCommandTest.php
  85. 0 2
      tests/Predis/Command/ServerBackgroundRewriteAOFTest.php
  86. 0 2
      tests/Predis/Command/ServerBackgroundSaveTest.php
  87. 0 2
      tests/Predis/Command/ServerClientTest.php
  88. 0 2
      tests/Predis/Command/ServerConfigTest.php
  89. 0 2
      tests/Predis/Command/ServerDatabaseSizeTest.php
  90. 0 2
      tests/Predis/Command/ServerEvalSHATest.php
  91. 0 2
      tests/Predis/Command/ServerEvalTest.php
  92. 0 2
      tests/Predis/Command/ServerFlushAllTest.php
  93. 0 2
      tests/Predis/Command/ServerFlushDatabaseTest.php
  94. 0 2
      tests/Predis/Command/ServerInfoTest.php
  95. 0 2
      tests/Predis/Command/ServerInfoV26xTest.php
  96. 0 2
      tests/Predis/Command/ServerLastSaveTest.php
  97. 0 2
      tests/Predis/Command/ServerMonitorTest.php
  98. 0 2
      tests/Predis/Command/ServerObjectTest.php
  99. 0 2
      tests/Predis/Command/ServerSaveTest.php
  100. 0 2
      tests/Predis/Command/ServerScriptTest.php

+ 0 - 2
bin/generate-command-test.php

@@ -171,8 +171,6 @@ class CommandTestCaseGenerator
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use \PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-$realm
  * @group realm-$realm

+ 13 - 6
tests/PHPUnit/ArrayHasSameValuesConstraint.php

@@ -27,15 +27,14 @@ class ArrayHasSameValuesConstraint extends PHPUnit_Framework_Constraint
     /**
     /**
      * {@inheritdoc}
      * {@inheritdoc}
      */
      */
-    public function evaluate($other, $description = '', $returnResult = FALSE)
+    public function matches($other)
     {
     {
-        $description = $description ?: 'Failed asserting that two arrays have the same elements.';
-
         if (count($this->array) !== count($other)) {
         if (count($this->array) !== count($other)) {
-            throw new PHPUnit_Framework_ExpectationFailedException($description);
+            return false;
         }
         }
+
         if (array_diff($this->array, $other)) {
         if (array_diff($this->array, $other)) {
-            throw new PHPUnit_Framework_ExpectationFailedException($description);
+            return false;
         }
         }
 
 
         return true;
         return true;
@@ -46,6 +45,14 @@ class ArrayHasSameValuesConstraint extends PHPUnit_Framework_Constraint
      */
      */
     public function toString()
     public function toString()
     {
     {
-        return 'two arrays have the same elements.';
+        return 'two arrays contain the same elements.';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function failureDescription($other)
+    {
+        return $this->toString();
     }
     }
 }
 }

+ 8 - 118
tests/PHPUnit/CommandTestCase.php

@@ -11,15 +11,14 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Client;
 use Predis\Client;
 use Predis\Profile;
 use Predis\Profile;
 
 
 /**
 /**
  *
  *
  */
  */
-abstract class CommandTestCase extends StandardTestCase
+abstract class CommandTestCase extends PredisTestCase
 {
 {
     /**
     /**
      * Returns the expected command.
      * Returns the expected command.
@@ -47,46 +46,21 @@ abstract class CommandTestCase extends StandardTestCase
         return $command instanceof CommandInterface ? $command : new $command();
         return $command instanceof CommandInterface ? $command : new $command();
     }
     }
 
 
-    /**
-     * Return the server profile used during the tests.
-     *
-     * @return Profile\ProfileInterface
-     */
-    public function getProfile()
-    {
-        return Profile\Factory::get(REDIS_SERVER_VERSION);
-    }
-
     /**
     /**
      * Returns a new client instance.
      * Returns a new client instance.
      *
      *
-     * @param Boolean $connect Flush selected database before returning the client.
+     * @param bool $connect Flush selected database before returning the client.
      * @return Client
      * @return Client
      */
      */
     public function getClient($flushdb = true)
     public function getClient($flushdb = true)
     {
     {
-        $profile = $this->getProfile();
-
-        if (!$profile->supportsCommand($id = $this->getExpectedId())) {
-            $this->markTestSkipped("The profile {$profile->getVersion()} does not support command {$id}");
+        if (!$this->getProfile()->supportsCommand($id = $this->getExpectedId())) {
+            $this->markTestSkipped(
+                "The profile {$profile->getVersion()} does not support command {$id}"
+            );
         }
         }
 
 
-        $parameters = array(
-            'host' => REDIS_SERVER_HOST,
-            'port' => REDIS_SERVER_PORT,
-        );
-
-        $options = array(
-            'profile' => $profile
-        );
-
-        $client = new Client($parameters, $options);
-        $client->connect();
-        $client->select(REDIS_SERVER_DBNUM);
-
-        if ($flushdb) {
-            $client->flushdb();
-        }
+        $client = $this->createClient(null, null, $flushdb);
 
 
         return $client;
         return $client;
     }
     }
@@ -126,27 +100,6 @@ abstract class CommandTestCase extends StandardTestCase
         return $command;
         return $command;
     }
     }
 
 
-    /**
-     * Sleep the test case with microseconds resolution.
-     *
-     * @param float $seconds Seconds to sleep.
-     */
-    protected function sleep($seconds)
-    {
-        usleep($seconds * 1000000);
-    }
-
-    /**
-     * Asserts that two arrays have the same values, even if with different order.
-     *
-     * @param array $expected Expected array.
-     * @param array $actual Actual array.
-     */
-    protected function assertSameValues(array $expected, array $actual)
-    {
-        $this->assertThat($expected, new \ArrayHasSameValuesConstraint($actual));
-    }
-
     /**
     /**
      * @group disconnected
      * @group disconnected
      */
      */
@@ -158,69 +111,6 @@ abstract class CommandTestCase extends StandardTestCase
         $this->assertEquals($this->getExpectedId(), $command->getId());
         $this->assertEquals($this->getExpectedId(), $command->getId());
     }
     }
 
 
-    /**
-     * @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)
-    {
-        $client = $this->getClient();
-        $info = array_change_key_case($client->info());
-
-        if (isset($info['server']['redis_version'])) {
-            // Redis >= 2.6
-            $version = $info['server']['redis_version'];
-        } else if (isset($info['redis_version'])) {
-            // Redis < 2.6
-            $version = $info['redis_version'];
-        } else {
-            throw new \RuntimeException('Unable to retrieve server info');
-        }
-
-        $comparation = version_compare($version, $expectedVersion);
-
-        if ($match = eval("return $comparation $operator 0;")) {
-            call_user_func($callback, $this, $version);
-        }
-
-        return $match;
-    }
-
-    /**
-     * @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)
-    {
-        $profile = $this->getProfile();
-        $comparation = version_compare($profile->getVersion(), $expectedVersion);
-
-        if ($match = eval("return $comparation $operator 0;")) {
-            call_user_func($callback, $this, $version);
-        }
-
-        return $match;
-    }
-
-    /**
-     * @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
-     */
-    protected function markTestSkippedOnRedisVersionBelow($expectedVersion, $message = '', $remote = true)
-    {
-        $callback = function ($test, $version) use ($message, $expectedVersion) {
-            $test->markTestSkipped($message ?: "Test requires Redis $expectedVersion, current is $version.");
-        };
-
-        $method = $remote ? 'executeOnRedisVersion' : 'executeOnProfileVersion';
-        $this->$method($expectedVersion, '<', $callback);
-    }
-
     /**
     /**
      * @group disconnected
      * @group disconnected
      */
      */

+ 2 - 28
tests/PHPUnit/ConnectionTestCase.php

@@ -11,14 +11,13 @@
 
 
 namespace Predis\Connection;
 namespace Predis\Connection;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Profile;
 use Predis\Profile;
 
 
 /**
 /**
  * @group realm-connection
  * @group realm-connection
  */
  */
-abstract class ConnectionTestCase extends StandardTestCase
+abstract class ConnectionTestCase extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected
@@ -322,31 +321,6 @@ abstract class ConnectionTestCase extends StandardTestCase
         );
         );
     }
     }
 
 
-    /**
-     * Returns a new instance of connection parameters.
-     *
-     * @param array $additional Additional connection parameters.
-     * @return ConnectionParameters Default connection parameters.
-     */
-    protected function getParameters($additional = array())
-    {
-        $parameters = array_merge($this->getDefaultParametersArray(), $additional);
-        $parameters = new ConnectionParameters($parameters);
-
-        return $parameters;
-    }
-
-    /**
-     * Returns a new instance of server profile.
-     *
-     * @param array $additional Additional connection parameters.
-     * @return Profile\ProfileInterface
-     */
-    protected function getProfile($version = null)
-    {
-        return Profile\Factory::get($version ?: REDIS_SERVER_VERSION);
-    }
-
     /**
     /**
      * Returns a new instance of a connection instance.
      * Returns a new instance of a connection instance.
      *
      *

+ 2 - 2
tests/PHPUnit/DistributorTestCase.php

@@ -11,12 +11,12 @@
 
 
 namespace Predis\Cluster\Distributor;
 namespace Predis\Cluster\Distributor;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
+use PredisTestCase;
 
 
 /**
 /**
  *
  *
  */
  */
-abstract class DistributorTestCase extends StandardTestCase
+abstract class DistributorTestCase extends PredisTestCase
 {
 {
     /**
     /**
      * Returns a new instance of the tested distributor.
      * Returns a new instance of the tested distributor.

+ 232 - 0
tests/PHPUnit/PredisTestCase.php

@@ -0,0 +1,232 @@
+<?php
+
+/*
+ * This file is part of the Predis package.
+ *
+ * (c) Daniele Alessandri <suppakilla@gmail.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+use Predis\Client;
+use Predis\Command;
+use Predis\Connection;
+use Predis\Profile;
+
+/**
+ * Base test case class for the Predis test suite.
+ */
+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.
+     */
+    public function isRedisCommand($command = null, array $arguments = null)
+    {
+        return new RedisCommandConstraint($command, $arguments);
+    }
+
+    /**
+     * Verifies that a Redis command is a valid Predis\Command\CommandInterface
+     * instance with the specified ID and command arguments. The comparison does
+     * not check for identity when passing a Predis\Command\CommandInterface
+     * instance for $expected.
+     *
+     * @param array|string|CommandInterface $expected Expected command.
+     * @param mixed $actual Actual command.
+     */
+    public function assertRedisCommand($expected, $actual)
+    {
+        if (is_array($expected)) {
+            @list($command, $arguments) = $expected;
+        } else {
+            $command = $expected;
+            $arguments = null;
+        }
+
+        $this->assertThat($actual, new RedisCommandConstraint($command, $arguments));
+    }
+
+    /**
+     * Asserts that two arrays have the same values, even if with different order.
+     *
+     * @param array $expected Expected array.
+     * @param array $actual Actual array.
+     */
+    public function assertSameValues(array $expected, array $actual)
+    {
+        $this->assertThat($actual, new ArrayHasSameValuesConstraint($expected));
+    }
+
+    /**
+     * Returns a named array with the default connection parameters and their values.
+     *
+     * @return array Default connection parameters.
+     */
+    protected function getDefaultParametersArray()
+    {
+        return array(
+            'scheme' => 'tcp',
+            'host' => REDIS_SERVER_HOST,
+            'port' => REDIS_SERVER_PORT,
+            'database' => REDIS_SERVER_DBNUM,
+        );
+    }
+
+    /**
+     * Returns a named array with the default client options and their values.
+     *
+     * @return array Default connection parameters.
+     */
+    protected function getDefaultOptionsArray()
+    {
+        return array(
+            'profile' => REDIS_SERVER_VERSION,
+        );
+    }
+
+    /**
+     * Returns a named array with the default connection parameters merged with
+     * the specified additional parameters.
+     *
+     * @param array $additional Additional connection parameters.
+     * @return array Connection parameters.
+     */
+    protected function getParametersArray(array $additional)
+    {
+        return array_merge($this->getDefaultParametersArray(), $additional);
+    }
+
+    /**
+     * Returns a new instance of connection parameters.
+     *
+     * @param array $additional Additional connection parameters.
+     * @return Connection\ConnectionParameters Default connection parameters.
+     */
+    protected function getParameters($additional = array())
+    {
+        $parameters = array_merge($this->getDefaultParametersArray(), $additional);
+        $parameters = new Connection\ConnectionParameters($parameters);
+
+        return $parameters;
+    }
+
+    /**
+     * Returns a new instance of server profile.
+     *
+     * @param array $additional Additional connection parameters.
+     * @return Profile\ProfileInterface
+     */
+    protected function getProfile($version = null)
+    {
+        return Profile\Factory::get($version ?: REDIS_SERVER_VERSION);
+    }
+
+    /**
+     * Returns a new client instance.
+     *
+     * @param bool $connect Flush selected database before returning the client.
+     * @return Client
+     */
+    protected function createClient(array $parameters = null, array $options = null, $flushdb = true)
+    {
+        $parameters = array_merge(
+            $this->getDefaultParametersArray(),
+            $parameters ?: array()
+        );
+
+        $options = array_merge(
+            array(
+                'profile' => $this->getProfile(),
+            ),
+            $options ?: array()
+        );
+
+        $client = new Client($parameters, $options);
+        $client->connect();
+
+        if ($flushdb) {
+            $client->flushdb();
+        }
+
+        return $client;
+    }
+
+    /**
+     * @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)
+    {
+        $client = $this->createClient(null, null, true);
+        $info = array_change_key_case($client->info());
+
+        if (isset($info['server']['redis_version'])) {
+            // Redis >= 2.6
+            $version = $info['server']['redis_version'];
+        } else if (isset($info['redis_version'])) {
+            // Redis < 2.6
+            $version = $info['redis_version'];
+        } else {
+            throw new RuntimeException('Unable to retrieve server info');
+        }
+
+        $comparation = version_compare($version, $expectedVersion);
+
+        if ($match = eval("return $comparation $operator 0;")) {
+            call_user_func($callback, $this, $version);
+        }
+
+        return $match;
+    }
+
+    /**
+     * @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)
+    {
+        $profile = $this->getProfile();
+        $comparation = version_compare($profile->getVersion(), $expectedVersion);
+
+        if ($match = eval("return $comparation $operator 0;")) {
+            call_user_func($callback, $this, $version);
+        }
+
+        return $match;
+    }
+
+    /**
+     * @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)
+    {
+        $callback = function ($test, $version) use ($message, $expectedVersion) {
+            $test->markTestSkipped($message ?: "Test requires Redis $expectedVersion, current is $version.");
+        };
+
+        $method = $remote ? 'executeOnRedisVersion' : 'executeOnProfileVersion';
+        $this->$method($expectedVersion, '<', $callback);
+    }
+
+    /**
+     * Sleep the test case with microseconds resolution.
+     *
+     * @param float $seconds Seconds to sleep.
+     */
+    protected function sleep($seconds)
+    {
+        usleep($seconds * 1000000);
+    }
+}

+ 22 - 20
tests/PHPUnit/RedisProfileTestCase.php

@@ -11,21 +11,23 @@
 
 
 namespace Predis\Profile;
 namespace Predis\Profile;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Command\Processor\ProcessorChain;
 use Predis\Command\Processor\ProcessorChain;
 
 
 /**
 /**
  *
  *
  */
  */
-abstract class RedisProfileTestCase extends StandardTestCase
+abstract class RedisProfileTestCase extends PredisTestCase
 {
 {
     /**
     /**
      * Returns a new instance of the tested profile.
      * Returns a new instance of the tested profile.
      *
      *
      * @return ProfileInterface
      * @return ProfileInterface
      */
      */
-    protected abstract function getProfileInstance();
+    protected function getProfile($version = null)
+    {
+        $this->markTestIncomplete("Server profile must be defined in ".get_class($this));
+    }
 
 
     /**
     /**
      * Returns the expected version string for the tested profile.
      * Returns the expected version string for the tested profile.
@@ -60,7 +62,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testGetVersion()
     public function testGetVersion()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
 
 
         $this->assertEquals($this->getExpectedVersion(), $profile->getVersion());
         $this->assertEquals($this->getExpectedVersion(), $profile->getVersion());
     }
     }
@@ -70,7 +72,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testSupportedCommands()
     public function testSupportedCommands()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
         $expected = $this->getExpectedCommands();
         $expected = $this->getExpectedCommands();
         $commands = $this->getCommands($profile);
         $commands = $this->getCommands($profile);
 
 
@@ -82,7 +84,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testToString()
     public function testToString()
     {
     {
-        $this->assertEquals($this->getExpectedVersion(), $this->getProfileInstance());
+        $this->assertEquals($this->getExpectedVersion(), $this->getProfile());
     }
     }
 
 
     /**
     /**
@@ -90,7 +92,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testSupportCommand()
     public function testSupportCommand()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
 
 
         $this->assertTrue($profile->supportsCommand('info'));
         $this->assertTrue($profile->supportsCommand('info'));
         $this->assertTrue($profile->supportsCommand('INFO'));
         $this->assertTrue($profile->supportsCommand('INFO'));
@@ -104,7 +106,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testSupportCommands()
     public function testSupportCommands()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
 
 
         $this->assertTrue($profile->supportsCommands(array('get', 'set')));
         $this->assertTrue($profile->supportsCommands(array('get', 'set')));
         $this->assertTrue($profile->supportsCommands(array('GET', 'SET')));
         $this->assertTrue($profile->supportsCommands(array('GET', 'SET')));
@@ -119,7 +121,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testGetCommandClass()
     public function testGetCommandClass()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
 
 
         $this->assertSame('Predis\Command\ConnectionPing', $profile->getCommandClass('ping'));
         $this->assertSame('Predis\Command\ConnectionPing', $profile->getCommandClass('ping'));
         $this->assertSame('Predis\Command\ConnectionPing', $profile->getCommandClass('PING'));
         $this->assertSame('Predis\Command\ConnectionPing', $profile->getCommandClass('PING'));
@@ -133,7 +135,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testDefineCommand()
     public function testDefineCommand()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
         $command = $this->getMock('Predis\Command\CommandInterface');
         $command = $this->getMock('Predis\Command\CommandInterface');
 
 
         $profile->defineCommand('mock', get_class($command));
         $profile->defineCommand('mock', get_class($command));
@@ -151,7 +153,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testDefineInvalidCommand()
     public function testDefineInvalidCommand()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
 
 
         $profile->defineCommand('mock', 'stdClass');
         $profile->defineCommand('mock', 'stdClass');
     }
     }
@@ -161,7 +163,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testCreateCommandWithoutArguments()
     public function testCreateCommandWithoutArguments()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
 
 
         $command = $profile->createCommand('info');
         $command = $profile->createCommand('info');
         $this->assertInstanceOf('Predis\Command\CommandInterface', $command);
         $this->assertInstanceOf('Predis\Command\CommandInterface', $command);
@@ -174,7 +176,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testCreateCommandWithArguments()
     public function testCreateCommandWithArguments()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
         $arguments = array('foo', 'bar');
         $arguments = array('foo', 'bar');
 
 
         $command = $profile->createCommand('set', $arguments);
         $command = $profile->createCommand('set', $arguments);
@@ -190,7 +192,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testCreateUndefinedCommand()
     public function testCreateUndefinedCommand()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
         $profile->createCommand('unknown');
         $profile->createCommand('unknown');
     }
     }
 
 
@@ -199,7 +201,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
      */
      */
     public function testGetDefaultProcessor()
     public function testGetDefaultProcessor()
     {
     {
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
 
 
         $this->assertNull($profile->getProcessor());
         $this->assertNull($profile->getProcessor());
     }
     }
@@ -211,7 +213,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
     {
     {
         $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface');
         $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface');
 
 
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
         $profile->setProcessor($processor);
         $profile->setProcessor($processor);
 
 
         $this->assertSame($processor, $profile->getProcessor());
         $this->assertSame($processor, $profile->getProcessor());
@@ -223,7 +225,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
     public function testSetAndUnsetProcessor()
     public function testSetAndUnsetProcessor()
     {
     {
         $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface');
         $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface');
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
 
 
         $profile->setProcessor($processor);
         $profile->setProcessor($processor);
         $this->assertSame($processor, $profile->getProcessor());
         $this->assertSame($processor, $profile->getProcessor());
@@ -249,7 +251,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
                         $cmd->setRawArguments($argsRef = array_map('strtoupper', $cmd->getArguments()));
                         $cmd->setRawArguments($argsRef = array_map('strtoupper', $cmd->getArguments()));
                     }));
                     }));
 
 
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
         $profile->setProcessor($processor);
         $profile->setProcessor($processor);
         $command = $profile->createCommand('set', array('foo', 'bar'));
         $command = $profile->createCommand('set', array('foo', 'bar'));
 
 
@@ -269,7 +271,7 @@ abstract class RedisProfileTestCase extends StandardTestCase
         $chain->add($processor);
         $chain->add($processor);
         $chain->add($processor);
         $chain->add($processor);
 
 
-        $profile = $this->getProfileInstance();
+        $profile = $this->getProfile();
         $profile->setProcessor($chain);
         $profile->setProcessor($chain);
         $profile->createCommand('info');
         $profile->createCommand('info');
     }
     }

+ 2 - 2
tests/Predis/ClientExceptionTest.php

@@ -11,12 +11,12 @@
 
 
 namespace Predis;
 namespace Predis;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
+use PredisTestCase;
 
 
 /**
 /**
  *
  *
  */
  */
-class ClientExceptionTest extends StandardTestCase
+class ClientExceptionTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 42
tests/Predis/ClientTest.php

@@ -11,8 +11,7 @@
 
 
 namespace Predis;
 namespace Predis;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Connection\ConnectionFactory;
 use Predis\Connection\ConnectionFactory;
 use Predis\Connection\MasterSlaveReplication;
 use Predis\Connection\MasterSlaveReplication;
 use Predis\Connection\PredisCluster;
 use Predis\Connection\PredisCluster;
@@ -22,7 +21,7 @@ use Predis\Response;
 /**
 /**
  *
  *
  */
  */
-class ClientTest extends StandardTestCase
+class ClientTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected
@@ -756,45 +755,6 @@ class ClientTest extends StandardTestCase
     // ---- HELPER METHODS ------------------------------------------------ //
     // ---- HELPER METHODS ------------------------------------------------ //
     // ******************************************************************** //
     // ******************************************************************** //
 
 
-    /**
-     * Returns a named array with the default connection parameters and their values.
-     *
-     * @return array Default connection parameters.
-     */
-    protected function getDefaultParametersArray()
-    {
-        return array(
-            'scheme' => 'tcp',
-            'host' => REDIS_SERVER_HOST,
-            'port' => REDIS_SERVER_PORT,
-            'database' => REDIS_SERVER_DBNUM,
-        );
-    }
-
-    /**
-     * Returns a named array with the default client options and their values.
-     *
-     * @return array Default connection parameters.
-     */
-    protected function getDefaultOptionsArray()
-    {
-        return array(
-            'profile' => REDIS_SERVER_VERSION,
-        );
-    }
-
-    /**
-     * Returns a named array with the default connection parameters merged with
-     * the specified additional parameters.
-     *
-     * @param array $additional Additional connection parameters.
-     * @return array Connection parameters.
-     */
-    protected function getParametersArray(array $additional)
-    {
-        return array_merge($this->getDefaultParametersArray(), $additional);
-    }
-
     /**
     /**
      * Returns an URI string representation of the specified connection parameters.
      * Returns an URI string representation of the specified connection parameters.
      *
      *

+ 2 - 2
tests/Predis/Cluster/Distributor/EmptyRingExceptionTest.php

@@ -11,12 +11,12 @@
 
 
 namespace Predis\Cluster\Distributor;
 namespace Predis\Cluster\Distributor;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
+use PredisTestCase;
 
 
 /**
 /**
  * @todo Not really useful right now.
  * @todo Not really useful right now.
  */
  */
-class EmptyRingExceptionTest extends StandardTestCase
+class EmptyRingExceptionTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 3
tests/Predis/Cluster/PredisStrategyTest.php

@@ -11,14 +11,13 @@
 
 
 namespace Predis\Cluster;
 namespace Predis\Cluster;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Profile;
 use Predis\Profile;
 
 
 /**
 /**
  *
  *
  */
  */
-class PredisStrategyTest extends StandardTestCase
+class PredisStrategyTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 3
tests/Predis/Cluster/RedisStrategyTest.php

@@ -11,14 +11,13 @@
 
 
 namespace Predis\Cluster;
 namespace Predis\Cluster;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Profile;
 use Predis\Profile;
 
 
 /**
 /**
  *
  *
  */
  */
-class RedisStrategyTest extends StandardTestCase
+class RedisStrategyTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 3
tests/Predis/Collection/Iterator/HashKeyTest.php

@@ -11,15 +11,14 @@
 
 
 namespace Predis\Collection\Iterator;
 namespace Predis\Collection\Iterator;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Client;
 use Predis\Client;
 use Predis\Profile;
 use Predis\Profile;
 
 
 /**
 /**
  * @group realm-iterators
  * @group realm-iterators
  */
  */
-class HashKeyTest extends StandardTestCase
+class HashKeyTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 3
tests/Predis/Collection/Iterator/KeyspaceTest.php

@@ -11,15 +11,14 @@
 
 
 namespace Predis\Collection\Iterator;
 namespace Predis\Collection\Iterator;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Client;
 use Predis\Client;
 use Predis\Profile;
 use Predis\Profile;
 
 
 /**
 /**
  * @group realm-iterators
  * @group realm-iterators
  */
  */
-class KeyspaceTest extends StandardTestCase
+class KeyspaceTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

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

@@ -11,15 +11,14 @@
 
 
 namespace Predis\Collection\Iterator;
 namespace Predis\Collection\Iterator;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Client;
 use Predis\Client;
 use Predis\Profile;
 use Predis\Profile;
 
 
 /**
 /**
  * @group realm-iterators
  * @group realm-iterators
  */
  */
-class ListKeyTest extends StandardTestCase
+class ListKeyTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 3
tests/Predis/Collection/Iterator/SetKeyTest.php

@@ -11,15 +11,14 @@
 
 
 namespace Predis\Collection\Iterator;
 namespace Predis\Collection\Iterator;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Client;
 use Predis\Client;
 use Predis\Profile;
 use Predis\Profile;
 
 
 /**
 /**
  * @group realm-iterators
  * @group realm-iterators
  */
  */
-class SetKeyTest extends StandardTestCase
+class SetKeyTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 3
tests/Predis/Collection/Iterator/SortedSetKeyTest.php

@@ -11,15 +11,14 @@
 
 
 namespace Predis\Collection\Iterator;
 namespace Predis\Collection\Iterator;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
+use PredisTestCase;
 use Predis\Client;
 use Predis\Client;
 use Predis\Profile;
 use Predis\Profile;
 
 
 /**
 /**
  * @group realm-iterators
  * @group realm-iterators
  */
  */
-class SortedSetTest extends StandardTestCase
+class SortedSetTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 2
tests/Predis/Command/CommandTest.php

@@ -11,12 +11,12 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
+use PredisTestCase;
 
 
 /**
 /**
  *
  *
  */
  */
-class CommandTest extends StandardTestCase
+class CommandTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-connection
  * @group realm-connection

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-connection
  * @group realm-connection

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-connection
  * @group realm-connection

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-connection
  * @group realm-connection

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-connection
  * @group realm-connection

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-hash
  * @group realm-hash

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * We only perform disconnected tests for this commands because
  * We only perform disconnected tests for this commands because
  * it is too old (Redis v1.2) and expects a different response
  * it is too old (Redis v1.2) and expects a different response

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-key
  * @group realm-key

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-list
  * @group realm-list

+ 2 - 2
tests/Predis/Command/Processor/KeyPrefixProcessorTest.php

@@ -12,13 +12,13 @@
 namespace Predis\Command\Processor;
 namespace Predis\Command\Processor;
 
 
 use stdClass;
 use stdClass;
-use PHPUnit_Framework_TestCase as StandardTestCase;
+use PredisTestCase;
 use Predis\Command\RawCommand;
 use Predis\Command\RawCommand;
 
 
 /**
 /**
  *
  *
  */
  */
-class KeyPrefixProcessorTest extends StandardTestCase
+class KeyPrefixProcessorTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 2
tests/Predis/Command/Processor/ProcessorChainTest.php

@@ -11,12 +11,12 @@
 
 
 namespace Predis\Command\Processor;
 namespace Predis\Command\Processor;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
+use PredisTestCase;
 
 
 /**
 /**
  *
  *
  */
  */
-class ProcessorChainTest extends StandardTestCase
+class ProcessorChainTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-pubsub
  * @group realm-pubsub

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-pubsub
  * @group realm-pubsub

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-pubsub
  * @group realm-pubsub

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-pubsub
  * @group realm-pubsub

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-pubsub
  * @group realm-pubsub

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-pubsub
  * @group realm-pubsub

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

@@ -11,12 +11,12 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
+use PredisTestCase;
 
 
 /**
 /**
  *
  *
  */
  */
-class RawCommandTest extends StandardTestCase
+class RawCommandTest extends PredisTestCase
 {
 {
     /**
     /**
      * @group disconnected
      * @group disconnected

+ 2 - 2
tests/Predis/Command/ScriptedCommandTest.php → tests/Predis/Command/ScriptCommandTest.php

@@ -11,12 +11,12 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
+use PredisTestCase;
 
 
 /**
 /**
  * @group realm-scripting
  * @group realm-scripting
  */
  */
-class ScriptCommandTest extends StandardTestCase
+class ScriptCommandTest extends PredisTestCase
 {
 {
     const LUA_SCRIPT = 'return { KEYS[1], KEYS[2], ARGV[1], ARGV[2] }';
     const LUA_SCRIPT = 'return { KEYS[1], KEYS[2], ARGV[1], ARGV[2] }';
     const LUA_SCRIPT_SHA1 = '6e07f61f502e36d123fe28523076af588f5c315e';
     const LUA_SCRIPT_SHA1 = '6e07f61f502e36d123fe28523076af588f5c315e';

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-scripting
  * @group realm-scripting

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-scripting
  * @group realm-scripting

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-server
  * @group realm-server

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

@@ -11,8 +11,6 @@
 
 
 namespace Predis\Command;
 namespace Predis\Command;
 
 
-use PHPUnit_Framework_TestCase as StandardTestCase;
-
 /**
 /**
  * @group commands
  * @group commands
  * @group realm-scripting
  * @group realm-scripting

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно