From a9b42924e548c5d5f35feb8d44d5e6c5e5771b80 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Sun, 1 Dec 2013 14:10:25 +0100 Subject: [PATCH] [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. NOTE: Backported from v0.9-dev. --- bin/generate-command-test.php | 4 +- .../PHPUnit/ArrayHasSameValuesConstraint.php | 24 +- tests/PHPUnit/CommandTestCase.php | 237 ------------------ tests/PHPUnit/PredisCommandTestCase.php | 127 ++++++++++ ...tCase.php => PredisConnectionTestCase.php} | 30 +-- ...Case.php => PredisDistributorTestCase.php} | 4 +- ...TestCase.php => PredisProfileTestCase.php} | 13 +- tests/PHPUnit/PredisTestCase.php | 233 +++++++++++++++++ tests/Predis/ClientExceptionTest.php | 4 +- tests/Predis/ClientTest.php | 44 +--- .../Distribution/EmptyRingExceptionTest.php | 4 +- .../Cluster/Distribution/HashRingTest.php | 2 +- .../Distribution/KetamaPureRingTest.php | 2 +- .../Cluster/PredisClusterHashStrategyTest.php | 5 +- .../Cluster/RedisClusterHashStrategyTest.php | 5 +- .../Collection/Iterator/HashKeyTest.php | 5 +- .../Collection/Iterator/KeyspaceTest.php | 5 +- .../Collection/Iterator/ListKeyTest.php | 5 +- .../Predis/Collection/Iterator/SetKeyTest.php | 5 +- .../Collection/Iterator/SortedSetKeyTest.php | 5 +- tests/Predis/Command/CommandTest.php | 4 +- tests/Predis/Command/ConnectionAuthTest.php | 4 +- tests/Predis/Command/ConnectionEchoTest.php | 4 +- tests/Predis/Command/ConnectionPingTest.php | 4 +- tests/Predis/Command/ConnectionQuitTest.php | 4 +- tests/Predis/Command/ConnectionSelectTest.php | 4 +- tests/Predis/Command/HashDeleteTest.php | 4 +- tests/Predis/Command/HashExistsTest.php | 4 +- tests/Predis/Command/HashGetAllTest.php | 4 +- tests/Predis/Command/HashGetMultipleTest.php | 4 +- tests/Predis/Command/HashGetTest.php | 4 +- .../Command/HashIncrementByFloatTest.php | 4 +- tests/Predis/Command/HashIncrementByTest.php | 4 +- tests/Predis/Command/HashKeysTest.php | 4 +- tests/Predis/Command/HashLengthTest.php | 4 +- tests/Predis/Command/HashScanTest.php | 4 +- tests/Predis/Command/HashSetMultipleTest.php | 4 +- tests/Predis/Command/HashSetPreserveTest.php | 4 +- tests/Predis/Command/HashSetTest.php | 4 +- tests/Predis/Command/HashValuesTest.php | 4 +- tests/Predis/Command/KeyDeleteTest.php | 4 +- tests/Predis/Command/KeyDumpTest.php | 4 +- tests/Predis/Command/KeyExistsTest.php | 4 +- tests/Predis/Command/KeyExpireAtTest.php | 4 +- tests/Predis/Command/KeyExpireTest.php | 4 +- tests/Predis/Command/KeyKeysTest.php | 4 +- tests/Predis/Command/KeyKeysV12xTest.php | 4 +- tests/Predis/Command/KeyMoveTest.php | 4 +- tests/Predis/Command/KeyPersistTest.php | 4 +- .../Predis/Command/KeyPreciseExpireAtTest.php | 4 +- tests/Predis/Command/KeyPreciseExpireTest.php | 4 +- .../Command/KeyPreciseTimeToLiveTest.php | 4 +- tests/Predis/Command/KeyRandomTest.php | 4 +- .../Predis/Command/KeyRenamePreserveTest.php | 4 +- tests/Predis/Command/KeyRenameTest.php | 4 +- tests/Predis/Command/KeyRestoreTest.php | 4 +- tests/Predis/Command/KeyScanTest.php | 5 +- tests/Predis/Command/KeySortTest.php | 4 +- tests/Predis/Command/KeyTimeToLiveTest.php | 4 +- tests/Predis/Command/KeyTypeTest.php | 4 +- tests/Predis/Command/ListIndexTest.php | 4 +- tests/Predis/Command/ListInsertTest.php | 4 +- tests/Predis/Command/ListLengthTest.php | 4 +- .../Command/ListPopFirstBlockingTest.php | 4 +- tests/Predis/Command/ListPopFirstTest.php | 4 +- .../Command/ListPopLastBlockingTest.php | 4 +- .../ListPopLastPushHeadBlockingTest.php | 4 +- .../Command/ListPopLastPushHeadTest.php | 4 +- tests/Predis/Command/ListPopLastTest.php | 4 +- tests/Predis/Command/ListPushHeadTest.php | 4 +- tests/Predis/Command/ListPushHeadXTest.php | 4 +- tests/Predis/Command/ListPushTailTest.php | 4 +- tests/Predis/Command/ListPushTailXTest.php | 4 +- tests/Predis/Command/ListRangeTest.php | 4 +- tests/Predis/Command/ListRemoveTest.php | 4 +- tests/Predis/Command/ListSetTest.php | 4 +- tests/Predis/Command/ListTrimTest.php | 4 +- tests/Predis/Command/PrefixHelpersTest.php | 4 +- .../Predis/Command/PrefixableCommandTest.php | 4 +- .../Processor/KeyPrefixProcessorTest.php | 4 +- .../Command/Processor/ProcessorChainTest.php | 4 +- tests/Predis/Command/PubSubPublishTest.php | 4 +- .../Command/PubSubSubscribeByPatternTest.php | 4 +- tests/Predis/Command/PubSubSubscribeTest.php | 4 +- .../PubSubUnsubscribeByPatternTest.php | 4 +- .../Predis/Command/PubSubUnsubscribeTest.php | 4 +- tests/Predis/Command/RawCommandTest.php | 4 +- tests/Predis/Command/ScriptedCommandTest.php | 4 +- .../ServerBackgroundRewriteAOFTest.php | 4 +- .../Command/ServerBackgroundSaveTest.php | 4 +- tests/Predis/Command/ServerClientTest.php | 4 +- tests/Predis/Command/ServerConfigTest.php | 4 +- .../Predis/Command/ServerDatabaseSizeTest.php | 4 +- tests/Predis/Command/ServerEvalSHATest.php | 4 +- tests/Predis/Command/ServerEvalTest.php | 4 +- tests/Predis/Command/ServerFlushAllTest.php | 4 +- .../Command/ServerFlushDatabaseTest.php | 4 +- tests/Predis/Command/ServerInfoTest.php | 4 +- tests/Predis/Command/ServerInfoV26xTest.php | 4 +- tests/Predis/Command/ServerLastSaveTest.php | 4 +- tests/Predis/Command/ServerMonitorTest.php | 4 +- tests/Predis/Command/ServerObjectTest.php | 4 +- tests/Predis/Command/ServerSaveTest.php | 4 +- tests/Predis/Command/ServerScriptTest.php | 4 +- tests/Predis/Command/ServerShutdownTest.php | 4 +- tests/Predis/Command/ServerSlaveOfTest.php | 4 +- tests/Predis/Command/ServerSlowlogTest.php | 4 +- tests/Predis/Command/ServerTimeTest.php | 4 +- tests/Predis/Command/SetAddTest.php | 4 +- tests/Predis/Command/SetCardinalityTest.php | 4 +- .../Predis/Command/SetDifferenceStoreTest.php | 4 +- tests/Predis/Command/SetDifferenceTest.php | 4 +- .../Command/SetIntersectionStoreTest.php | 4 +- tests/Predis/Command/SetIntersectionTest.php | 4 +- tests/Predis/Command/SetIsMemberTest.php | 4 +- tests/Predis/Command/SetMembersTest.php | 4 +- tests/Predis/Command/SetMoveTest.php | 4 +- tests/Predis/Command/SetPopTest.php | 4 +- tests/Predis/Command/SetRandomMemberTest.php | 4 +- tests/Predis/Command/SetRemoveTest.php | 4 +- tests/Predis/Command/SetScanTest.php | 4 +- tests/Predis/Command/SetUnionStoreTest.php | 4 +- tests/Predis/Command/SetUnionTest.php | 4 +- tests/Predis/Command/StringAppendTest.php | 4 +- tests/Predis/Command/StringBitCountTest.php | 4 +- tests/Predis/Command/StringBitOpTest.php | 4 +- .../Predis/Command/StringDecrementByTest.php | 4 +- tests/Predis/Command/StringDecrementTest.php | 4 +- tests/Predis/Command/StringGetBitTest.php | 4 +- .../Predis/Command/StringGetMultipleTest.php | 4 +- tests/Predis/Command/StringGetRangeTest.php | 4 +- tests/Predis/Command/StringGetSetTest.php | 4 +- tests/Predis/Command/StringGetTest.php | 4 +- .../Command/StringIncrementByFloatTest.php | 4 +- .../Predis/Command/StringIncrementByTest.php | 4 +- tests/Predis/Command/StringIncrementTest.php | 4 +- .../Command/StringPreciseSetExpireTest.php | 4 +- tests/Predis/Command/StringSetBitTest.php | 4 +- tests/Predis/Command/StringSetExpireTest.php | 4 +- .../Command/StringSetMultiplePreserveTest.php | 4 +- .../Predis/Command/StringSetMultipleTest.php | 4 +- .../Predis/Command/StringSetPreserveTest.php | 4 +- tests/Predis/Command/StringSetRangeTest.php | 4 +- tests/Predis/Command/StringSetTest.php | 4 +- tests/Predis/Command/StringStrlenTest.php | 4 +- tests/Predis/Command/StringSubstrTest.php | 4 +- .../Predis/Command/TransactionDiscardTest.php | 4 +- tests/Predis/Command/TransactionExecTest.php | 4 +- tests/Predis/Command/TransactionMultiTest.php | 4 +- .../Predis/Command/TransactionUnwatchTest.php | 4 +- tests/Predis/Command/TransactionWatchTest.php | 4 +- tests/Predis/Command/ZSetAddTest.php | 4 +- tests/Predis/Command/ZSetCardinalityTest.php | 4 +- tests/Predis/Command/ZSetCountTest.php | 4 +- tests/Predis/Command/ZSetIncrementByTest.php | 4 +- .../Command/ZSetIntersectionStoreTest.php | 4 +- tests/Predis/Command/ZSetRangeByScoreTest.php | 4 +- tests/Predis/Command/ZSetRangeTest.php | 4 +- tests/Predis/Command/ZSetRankTest.php | 4 +- .../Command/ZSetRemoveRangeByRankTest.php | 4 +- .../Command/ZSetRemoveRangeByScoreTest.php | 4 +- tests/Predis/Command/ZSetRemoveTest.php | 4 +- .../Command/ZSetReverseRangeByScoreTest.php | 4 +- tests/Predis/Command/ZSetReverseRangeTest.php | 4 +- tests/Predis/Command/ZSetReverseRankTest.php | 4 +- tests/Predis/Command/ZSetScanTest.php | 4 +- tests/Predis/Command/ZSetScoreTest.php | 4 +- tests/Predis/Command/ZSetUnionStoreTest.php | 4 +- tests/Predis/CommunicationExceptionTest.php | 5 +- .../ComposableStreamConnectionTest.php | 5 +- .../Connection/ConnectionFactoryTest.php | 5 +- .../Connection/ConnectionParametersTest.php | 17 +- .../Connection/MasterSlaveReplicationTest.php | 5 +- .../Connection/PhpiredisConnectionTest.php | 5 +- .../PhpiredisStreamConnectionTest.php | 6 +- tests/Predis/Connection/PredisClusterTest.php | 5 +- tests/Predis/Connection/RedisClusterTest.php | 5 +- .../Connection/StreamConnectionTest.php | 5 +- .../Connection/WebdisConnectionTest.php | 30 +-- tests/Predis/HelpersTest.php | 4 +- .../Iterator/MultiBulkResponseSimpleTest.php | 21 +- .../Iterator/MultiBulkResponseTupleTest.php | 21 +- tests/Predis/Monitor/MonitorContextTest.php | 5 +- tests/Predis/Option/AbstractOptionTest.php | 4 +- tests/Predis/Option/ClientClusterTest.php | 4 +- .../Option/ClientConnectionFactoryTest.php | 5 +- tests/Predis/Option/ClientExceptionsTest.php | 4 +- tests/Predis/Option/ClientOptionsTest.php | 4 +- tests/Predis/Option/ClientPrefixTest.php | 4 +- tests/Predis/Option/ClientProfileTest.php | 5 +- tests/Predis/Option/ClientReplicationTest.php | 4 +- tests/Predis/Option/CustomOptionTest.php | 4 +- .../Pipeline/FireAndForgetExecutorTest.php | 5 +- .../Predis/Pipeline/MultiExecExecutorTest.php | 5 +- tests/Predis/Pipeline/PipelineContextTest.php | 25 +- .../Predis/Pipeline/StandardExecutorTest.php | 5 +- tests/Predis/PredisExceptionTest.php | 4 +- tests/Predis/Profile/ServerProfileTest.php | 5 +- tests/Predis/Profile/ServerVersion12Test.php | 4 +- tests/Predis/Profile/ServerVersion20Test.php | 4 +- tests/Predis/Profile/ServerVersion22Test.php | 4 +- tests/Predis/Profile/ServerVersion24Test.php | 4 +- tests/Predis/Profile/ServerVersion26Test.php | 4 +- tests/Predis/Profile/ServerVersion28Test.php | 4 +- .../Predis/Profile/ServerVersionNextTest.php | 4 +- .../Text/ComposableTextProtocolTest.php | 4 +- .../Protocol/Text/ResponseBulkHandlerTest.php | 4 +- .../Text/ResponseErrorHandlerTest.php | 4 +- .../Text/ResponseIntegerHandlerTest.php | 4 +- .../Text/ResponseMultiBulkHandlerTest.php | 4 +- .../ResponseMultiBulkStreamHandlerTest.php | 4 +- .../Text/ResponseStatusHandlerTest.php | 4 +- .../Text/TextCommandSerializerTest.php | 4 +- .../Predis/Protocol/Text/TextProtocolTest.php | 4 +- .../Protocol/Text/TextResponseReaderTest.php | 4 +- tests/Predis/PubSub/DispatcherLoopTest.php | 5 +- tests/Predis/PubSub/PubSubContextTest.php | 5 +- .../Replication/ReplicationStrategyTest.php | 5 +- tests/Predis/ResponseErrorTest.php | 4 +- tests/Predis/ResponseQueuedTest.php | 4 +- tests/Predis/ServerExceptionTest.php | 4 +- .../AbortedMultiExecExceptionTest.php | 5 +- .../Transaction/MultiExecContextTest.php | 25 +- tests/bootstrap.php | 9 +- 224 files changed, 831 insertions(+), 890 deletions(-) delete mode 100644 tests/PHPUnit/CommandTestCase.php create mode 100644 tests/PHPUnit/PredisCommandTestCase.php rename tests/PHPUnit/{ConnectionTestCase.php => PredisConnectionTestCase.php} (92%) rename tests/PHPUnit/{DistributionStrategyTestCase.php => PredisDistributorTestCase.php} (92%) rename tests/PHPUnit/{ServerVersionTestCase.php => PredisProfileTestCase.php} (83%) create mode 100644 tests/PHPUnit/PredisTestCase.php diff --git a/bin/generate-command-test.php b/bin/generate-command-test.php index 51ccde3e..f69b0729 100755 --- a/bin/generate-command-test.php +++ b/bin/generate-command-test.php @@ -171,13 +171,11 @@ class CommandTestCaseGenerator namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; - /** * @group commands * @group realm-$realm */ -class $class extends CommandTestCase +class $class extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/PHPUnit/ArrayHasSameValuesConstraint.php b/tests/PHPUnit/ArrayHasSameValuesConstraint.php index c19cb781..13035bb6 100644 --- a/tests/PHPUnit/ArrayHasSameValuesConstraint.php +++ b/tests/PHPUnit/ArrayHasSameValuesConstraint.php @@ -9,9 +9,6 @@ * file that was distributed with this source code. */ -use \PHPUnit_Framework_Constraint; -use \PHPUnit_Framework_ExpectationFailedException; - /** * Constraint that accepts arrays with the same elements but different order. */ @@ -30,15 +27,14 @@ class ArrayHasSameValuesConstraint extends PHPUnit_Framework_Constraint /** * {@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)) { - throw new PHPUnit_Framework_ExpectationFailedException($description); + return false; } + if (array_diff($this->array, $other)) { - throw new PHPUnit_Framework_ExpectationFailedException($description); + return false; } return true; @@ -49,6 +45,14 @@ class ArrayHasSameValuesConstraint extends PHPUnit_Framework_Constraint */ public function toString() { - return 'two arrays have the same elements.'; + return 'two arrays contain the same elements.'; } -} \ No newline at end of file + + /** + * {@inheritdoc} + */ + protected function failureDescription($other) + { + return $this->toString(); + } +} diff --git a/tests/PHPUnit/CommandTestCase.php b/tests/PHPUnit/CommandTestCase.php deleted file mode 100644 index ac302ebe..00000000 --- a/tests/PHPUnit/CommandTestCase.php +++ /dev/null @@ -1,237 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -use \PHPUnit_Framework_TestCase as StandardTestCase; - -use Predis\Client; -use Predis\Profile\ServerProfile; -use Predis\Profile\ServerProfileInterface; - -/** - * - */ -abstract class CommandTestCase extends StandardTestCase -{ - /** - * Returns the expected command. - * - * @return CommandInterface|string Instance or FQN of the expected command. - */ - protected abstract function getExpectedCommand(); - - /** - * Returns the expected command ID. - * - * @return string - */ - protected abstract function getExpectedId(); - - /** - * Returns a new command instance. - * - * @return CommandInterface - */ - public function getCommand() - { - $command = $this->getExpectedCommand(); - - return $command instanceof CommandInterface ? $command : new $command(); - } - - /** - * Return the server profile used during the tests. - * - * @return ServerProfileInterface - */ - public function getProfile() - { - return ServerProfile::get(REDIS_SERVER_VERSION); - } - - /** - * Returns a new client instance. - * - * @param Boolean $connect Flush selected database before returning the client. - * @return Client - */ - 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}"); - } - - $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(); - } - - return $client; - } - - /** - * Returns wether the command is prefixable or not. - * - * @return Boolean - */ - protected function isPrefixable() - { - return $this->getCommand() instanceof PrefixableCommandInterface; - } - - /** - * Returns a new command instance with the specified arguments. - * - * @param ... List of arguments for the command. - * @return CommandInterface - */ - protected function getCommandWithArguments(/* arguments */) - { - return $this->getCommandWithArgumentsArray(func_get_args()); - } - - /** - * Returns a new command instance with the specified arguments. - * - * @param array $arguments Arguments for the command. - * @return CommandInterface - */ - protected function getCommandWithArgumentsArray(Array $arguments) - { - $command = $this->getCommand(); - $command->setArguments($arguments); - - 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 - */ - public function testCommandId() - { - $command = $this->getCommand(); - - $this->assertInstanceOf('Predis\Command\CommandInterface', $command); - $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 - */ - public function testRawArguments() - { - $expected = array('1st', '2nd', '3rd', '4th'); - - $command = $this->getCommand(); - $command->setRawArguments($expected); - - $this->assertSame($expected, $command->getArguments()); - } -} diff --git a/tests/PHPUnit/PredisCommandTestCase.php b/tests/PHPUnit/PredisCommandTestCase.php new file mode 100644 index 00000000..913f4c92 --- /dev/null +++ b/tests/PHPUnit/PredisCommandTestCase.php @@ -0,0 +1,127 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Predis\Command; + +use PredisTestCase; +use Predis\Client; + +/** + * + */ +abstract class PredisCommandTestCase extends PredisTestCase +{ + /** + * Returns the expected command. + * + * @return CommandInterface|string Instance or FQN of the expected command. + */ + protected abstract function getExpectedCommand(); + + /** + * Returns the expected command ID. + * + * @return string + */ + protected abstract function getExpectedId(); + + /** + * Returns a new command instance. + * + * @return CommandInterface + */ + public function getCommand() + { + $command = $this->getExpectedCommand(); + + return $command instanceof CommandInterface ? $command : new $command(); + } + + /** + * Returns a new client instance. + * + * @param bool $connect Flush selected database before returning the client. + * @return Client + */ + 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}" + ); + } + + $client = $this->createClient(null, null, $flushdb); + + return $client; + } + + /** + * Returns wether the command is prefixable or not. + * + * @return Boolean + */ + protected function isPrefixable() + { + return $this->getCommand() instanceof PrefixableCommandInterface; + } + + /** + * Returns a new command instance with the specified arguments. + * + * @param ... List of arguments for the command. + * @return CommandInterface + */ + protected function getCommandWithArguments(/* arguments */) + { + return $this->getCommandWithArgumentsArray(func_get_args()); + } + + /** + * Returns a new command instance with the specified arguments. + * + * @param array $arguments Arguments for the command. + * @return CommandInterface + */ + protected function getCommandWithArgumentsArray(Array $arguments) + { + $command = $this->getCommand(); + $command->setArguments($arguments); + + return $command; + } + + /** + * @group disconnected + */ + public function testCommandId() + { + $command = $this->getCommand(); + + $this->assertInstanceOf('Predis\Command\CommandInterface', $command); + $this->assertEquals($this->getExpectedId(), $command->getId()); + } + + /** + * @group disconnected + */ + public function testRawArguments() + { + $expected = array('1st', '2nd', '3rd', '4th'); + + $command = $this->getCommand(); + $command->setRawArguments($expected); + + $this->assertSame($expected, $command->getArguments()); + } +} diff --git a/tests/PHPUnit/ConnectionTestCase.php b/tests/PHPUnit/PredisConnectionTestCase.php similarity index 92% rename from tests/PHPUnit/ConnectionTestCase.php rename to tests/PHPUnit/PredisConnectionTestCase.php index b806e278..1ae70e00 100644 --- a/tests/PHPUnit/ConnectionTestCase.php +++ b/tests/PHPUnit/PredisConnectionTestCase.php @@ -11,14 +11,13 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Profile\ServerProfile; /** * @group realm-connection */ -abstract class ConnectionTestCase extends StandardTestCase +abstract class PredisConnectionTestCase extends PredisTestCase { /** * @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 ServerProfile - */ - protected function getProfile($version = null) - { - return ServerProfile::get($version ?: REDIS_SERVER_VERSION); - } - /** * Returns a new instance of a connection instance. * diff --git a/tests/PHPUnit/DistributionStrategyTestCase.php b/tests/PHPUnit/PredisDistributorTestCase.php similarity index 92% rename from tests/PHPUnit/DistributionStrategyTestCase.php rename to tests/PHPUnit/PredisDistributorTestCase.php index 1097d488..91bd1d4e 100644 --- a/tests/PHPUnit/DistributionStrategyTestCase.php +++ b/tests/PHPUnit/PredisDistributorTestCase.php @@ -11,12 +11,12 @@ namespace Predis\Cluster\Distribution; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -abstract class DistributionStrategyTestCase extends StandardTestCase +abstract class PredisDistributorTestCase extends PredisTestCase { /** * Returns a new instance of the tested distributor. diff --git a/tests/PHPUnit/ServerVersionTestCase.php b/tests/PHPUnit/PredisProfileTestCase.php similarity index 83% rename from tests/PHPUnit/ServerVersionTestCase.php rename to tests/PHPUnit/PredisProfileTestCase.php index aef28a34..67f67fb1 100644 --- a/tests/PHPUnit/ServerVersionTestCase.php +++ b/tests/PHPUnit/PredisProfileTestCase.php @@ -11,19 +11,22 @@ namespace Predis\Profile; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -abstract class ServerVersionTestCase extends StandardTestCase +abstract class PredisProfileTestCase extends PredisTestCase { /** * Returns a new instance of the tested profile. * * @return ServerProfileInterface */ - 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. @@ -58,7 +61,7 @@ abstract class ServerVersionTestCase extends StandardTestCase */ public function testGetVersion() { - $profile = $this->getProfileInstance(); + $profile = $this->getProfile(); $this->assertEquals($this->getExpectedVersion(), $profile->getVersion()); } @@ -68,7 +71,7 @@ abstract class ServerVersionTestCase extends StandardTestCase */ public function testSupportedCommands() { - $profile = $this->getProfileInstance(); + $profile = $this->getProfile(); $expected = $this->getExpectedCommands(); $commands = $this->getCommands($profile); diff --git a/tests/PHPUnit/PredisTestCase.php b/tests/PHPUnit/PredisTestCase.php new file mode 100644 index 00000000..2d265ee2 --- /dev/null +++ b/tests/PHPUnit/PredisTestCase.php @@ -0,0 +1,233 @@ + + * + * 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\CommandInterface; +use Predis\Connection\ConnectionParameters; +use Predis\Profile\ServerProfile; +use Predis\Profile\ServerProfileInterface; + +/** + * 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 ConnectionParameters($parameters); + + return $parameters; + } + + /** + * Returns a new instance of server profile. + * + * @param array $additional Additional connection parameters. + * @return ServerProfileInterface + */ + protected function getProfile($version = null) + { + return ServerProfile::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); + } +} diff --git a/tests/Predis/ClientExceptionTest.php b/tests/Predis/ClientExceptionTest.php index 13e6c94e..73471495 100644 --- a/tests/Predis/ClientExceptionTest.php +++ b/tests/Predis/ClientExceptionTest.php @@ -11,12 +11,12 @@ namespace Predis; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ClientExceptionTest extends StandardTestCase +class ClientExceptionTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/ClientTest.php b/tests/Predis/ClientTest.php index a999b963..5c3e41de 100644 --- a/tests/Predis/ClientTest.php +++ b/tests/Predis/ClientTest.php @@ -11,8 +11,7 @@ namespace Predis; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Connection\ConnectionFactory; use Predis\Connection\MasterSlaveReplication; use Predis\Connection\PredisCluster; @@ -21,7 +20,7 @@ use Predis\Profile\ServerProfile; /** * */ -class ClientTest extends StandardTestCase +class ClientTest extends PredisTestCase { /** * @group disconnected @@ -752,45 +751,6 @@ class ClientTest extends StandardTestCase // ---- 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. * diff --git a/tests/Predis/Cluster/Distribution/EmptyRingExceptionTest.php b/tests/Predis/Cluster/Distribution/EmptyRingExceptionTest.php index 9a11e0c4..379e78e5 100644 --- a/tests/Predis/Cluster/Distribution/EmptyRingExceptionTest.php +++ b/tests/Predis/Cluster/Distribution/EmptyRingExceptionTest.php @@ -11,12 +11,12 @@ namespace Predis\Cluster\Distribution; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @todo Not really useful right now. */ -class EmptyRingExceptionTest extends StandardTestCase +class EmptyRingExceptionTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Cluster/Distribution/HashRingTest.php b/tests/Predis/Cluster/Distribution/HashRingTest.php index e618ea00..efa09f3d 100644 --- a/tests/Predis/Cluster/Distribution/HashRingTest.php +++ b/tests/Predis/Cluster/Distribution/HashRingTest.php @@ -14,7 +14,7 @@ namespace Predis\Cluster\Distribution; /** * @todo To be improved. */ -class HashRingTest extends DistributionStrategyTestCase +class HashRingTest extends PredisDistributorTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Cluster/Distribution/KetamaPureRingTest.php b/tests/Predis/Cluster/Distribution/KetamaPureRingTest.php index b5c3145e..b3b1415d 100644 --- a/tests/Predis/Cluster/Distribution/KetamaPureRingTest.php +++ b/tests/Predis/Cluster/Distribution/KetamaPureRingTest.php @@ -14,7 +14,7 @@ namespace Predis\Cluster\Distribution; /** * @todo To be improved. */ -class KetamaPureRingTest extends DistributionStrategyTestCase +class KetamaPureRingTest extends PredisDistributorTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Cluster/PredisClusterHashStrategyTest.php b/tests/Predis/Cluster/PredisClusterHashStrategyTest.php index 1d907459..12be4314 100644 --- a/tests/Predis/Cluster/PredisClusterHashStrategyTest.php +++ b/tests/Predis/Cluster/PredisClusterHashStrategyTest.php @@ -11,15 +11,14 @@ namespace Predis\Cluster; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Cluster\Distribution\HashRing; use Predis\Profile\ServerProfile; /** * */ -class PredisClusterHashStrategyTest extends StandardTestCase +class PredisClusterHashStrategyTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Cluster/RedisClusterHashStrategyTest.php b/tests/Predis/Cluster/RedisClusterHashStrategyTest.php index dd89ac09..d403215c 100644 --- a/tests/Predis/Cluster/RedisClusterHashStrategyTest.php +++ b/tests/Predis/Cluster/RedisClusterHashStrategyTest.php @@ -11,14 +11,13 @@ namespace Predis\Cluster; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Profile\ServerProfile; /** * */ -class RedisClusterHashStrategyTest extends StandardTestCase +class RedisClusterHashStrategyTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Collection/Iterator/HashKeyTest.php b/tests/Predis/Collection/Iterator/HashKeyTest.php index 4fc11493..4c22a83d 100644 --- a/tests/Predis/Collection/Iterator/HashKeyTest.php +++ b/tests/Predis/Collection/Iterator/HashKeyTest.php @@ -11,15 +11,14 @@ namespace Predis\Collection\Iterator; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\Profile\ServerProfile; /** * @group realm-iterators */ -class HashKeyTest extends StandardTestCase +class HashKeyTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Collection/Iterator/KeyspaceTest.php b/tests/Predis/Collection/Iterator/KeyspaceTest.php index 28ad9390..70b4a79a 100644 --- a/tests/Predis/Collection/Iterator/KeyspaceTest.php +++ b/tests/Predis/Collection/Iterator/KeyspaceTest.php @@ -11,15 +11,14 @@ namespace Predis\Collection\Iterator; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\Profile\ServerProfile; /** * @group realm-iterators */ -class KeyspaceTest extends StandardTestCase +class KeyspaceTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Collection/Iterator/ListKeyTest.php b/tests/Predis/Collection/Iterator/ListKeyTest.php index ec789423..a0470d34 100644 --- a/tests/Predis/Collection/Iterator/ListKeyTest.php +++ b/tests/Predis/Collection/Iterator/ListKeyTest.php @@ -11,15 +11,14 @@ namespace Predis\Collection\Iterator; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\Profile\ServerProfile; /** * @group realm-iterators */ -class ListKeyTest extends StandardTestCase +class ListKeyTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Collection/Iterator/SetKeyTest.php b/tests/Predis/Collection/Iterator/SetKeyTest.php index ba2d7776..e8f89816 100644 --- a/tests/Predis/Collection/Iterator/SetKeyTest.php +++ b/tests/Predis/Collection/Iterator/SetKeyTest.php @@ -11,15 +11,14 @@ namespace Predis\Collection\Iterator; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\Profile\ServerProfile; /** * @group realm-iterators */ -class SetKeyTest extends StandardTestCase +class SetKeyTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Collection/Iterator/SortedSetKeyTest.php b/tests/Predis/Collection/Iterator/SortedSetKeyTest.php index c4485052..955a6997 100644 --- a/tests/Predis/Collection/Iterator/SortedSetKeyTest.php +++ b/tests/Predis/Collection/Iterator/SortedSetKeyTest.php @@ -11,15 +11,14 @@ namespace Predis\Collection\Iterator; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\Profile\ServerProfile; /** * @group realm-iterators */ -class SortedSetTest extends StandardTestCase +class SortedSetTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Command/CommandTest.php b/tests/Predis/Command/CommandTest.php index 05b2c645..627aada6 100644 --- a/tests/Predis/Command/CommandTest.php +++ b/tests/Predis/Command/CommandTest.php @@ -11,12 +11,12 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class CommandTest extends StandardTestCase +class CommandTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Command/ConnectionAuthTest.php b/tests/Predis/Command/ConnectionAuthTest.php index 03cd7a32..be4ceb8d 100644 --- a/tests/Predis/Command/ConnectionAuthTest.php +++ b/tests/Predis/Command/ConnectionAuthTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-connection */ -class ConnectionAuthTest extends CommandTestCase +class ConnectionAuthTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ConnectionEchoTest.php b/tests/Predis/Command/ConnectionEchoTest.php index ef7fa775..e942f83d 100644 --- a/tests/Predis/Command/ConnectionEchoTest.php +++ b/tests/Predis/Command/ConnectionEchoTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-connection */ -class ConnectionEchoTest extends CommandTestCase +class ConnectionEchoTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ConnectionPingTest.php b/tests/Predis/Command/ConnectionPingTest.php index 0b60e7ef..73dea93b 100644 --- a/tests/Predis/Command/ConnectionPingTest.php +++ b/tests/Predis/Command/ConnectionPingTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-connection */ -class ConnectionPingTest extends CommandTestCase +class ConnectionPingTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ConnectionQuitTest.php b/tests/Predis/Command/ConnectionQuitTest.php index 70ac484d..94e362a0 100644 --- a/tests/Predis/Command/ConnectionQuitTest.php +++ b/tests/Predis/Command/ConnectionQuitTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-connection */ -class ConnectionQuitTest extends CommandTestCase +class ConnectionQuitTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ConnectionSelectTest.php b/tests/Predis/Command/ConnectionSelectTest.php index 2e9854e0..8ede9d37 100644 --- a/tests/Predis/Command/ConnectionSelectTest.php +++ b/tests/Predis/Command/ConnectionSelectTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-connection */ -class ConnectionSelectTest extends CommandTestCase +class ConnectionSelectTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashDeleteTest.php b/tests/Predis/Command/HashDeleteTest.php index adb7c2bf..0f6e8c84 100644 --- a/tests/Predis/Command/HashDeleteTest.php +++ b/tests/Predis/Command/HashDeleteTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashDeleteTest extends CommandTestCase +class HashDeleteTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashExistsTest.php b/tests/Predis/Command/HashExistsTest.php index 7b27b722..7742c73a 100644 --- a/tests/Predis/Command/HashExistsTest.php +++ b/tests/Predis/Command/HashExistsTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashExistsTest extends CommandTestCase +class HashExistsTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashGetAllTest.php b/tests/Predis/Command/HashGetAllTest.php index 36c5c79e..5729c611 100644 --- a/tests/Predis/Command/HashGetAllTest.php +++ b/tests/Predis/Command/HashGetAllTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashGetAllTest extends CommandTestCase +class HashGetAllTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashGetMultipleTest.php b/tests/Predis/Command/HashGetMultipleTest.php index 4cabd2b4..dc833f77 100644 --- a/tests/Predis/Command/HashGetMultipleTest.php +++ b/tests/Predis/Command/HashGetMultipleTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashGetMultipleTest extends CommandTestCase +class HashGetMultipleTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashGetTest.php b/tests/Predis/Command/HashGetTest.php index b68067b6..b31c48cc 100644 --- a/tests/Predis/Command/HashGetTest.php +++ b/tests/Predis/Command/HashGetTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashGetTest extends CommandTestCase +class HashGetTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashIncrementByFloatTest.php b/tests/Predis/Command/HashIncrementByFloatTest.php index 286ebc5c..67f503f7 100644 --- a/tests/Predis/Command/HashIncrementByFloatTest.php +++ b/tests/Predis/Command/HashIncrementByFloatTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashIncrementByFloatTest extends CommandTestCase +class HashIncrementByFloatTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashIncrementByTest.php b/tests/Predis/Command/HashIncrementByTest.php index 2cf2bbff..39104bb8 100644 --- a/tests/Predis/Command/HashIncrementByTest.php +++ b/tests/Predis/Command/HashIncrementByTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashIncrementByTest extends CommandTestCase +class HashIncrementByTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashKeysTest.php b/tests/Predis/Command/HashKeysTest.php index 04c0a2d3..d2c2e419 100644 --- a/tests/Predis/Command/HashKeysTest.php +++ b/tests/Predis/Command/HashKeysTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashKeysTest extends CommandTestCase +class HashKeysTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashLengthTest.php b/tests/Predis/Command/HashLengthTest.php index 9c950b65..c100ddfb 100644 --- a/tests/Predis/Command/HashLengthTest.php +++ b/tests/Predis/Command/HashLengthTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashLengthTest extends CommandTestCase +class HashLengthTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashScanTest.php b/tests/Predis/Command/HashScanTest.php index 1ddefd62..f8e3d764 100644 --- a/tests/Predis/Command/HashScanTest.php +++ b/tests/Predis/Command/HashScanTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashScanTest extends CommandTestCase +class HashScanTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashSetMultipleTest.php b/tests/Predis/Command/HashSetMultipleTest.php index 5f9a1ef9..29015348 100644 --- a/tests/Predis/Command/HashSetMultipleTest.php +++ b/tests/Predis/Command/HashSetMultipleTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashSetMultipleTest extends CommandTestCase +class HashSetMultipleTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashSetPreserveTest.php b/tests/Predis/Command/HashSetPreserveTest.php index ca1b35d8..c91d6d3d 100644 --- a/tests/Predis/Command/HashSetPreserveTest.php +++ b/tests/Predis/Command/HashSetPreserveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashSetPreserveTest extends CommandTestCase +class HashSetPreserveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashSetTest.php b/tests/Predis/Command/HashSetTest.php index fee08e47..59c1d8d4 100644 --- a/tests/Predis/Command/HashSetTest.php +++ b/tests/Predis/Command/HashSetTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashSetTest extends CommandTestCase +class HashSetTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/HashValuesTest.php b/tests/Predis/Command/HashValuesTest.php index 6cedd8ed..c226d9bb 100644 --- a/tests/Predis/Command/HashValuesTest.php +++ b/tests/Predis/Command/HashValuesTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-hash */ -class HashValuesTest extends CommandTestCase +class HashValuesTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyDeleteTest.php b/tests/Predis/Command/KeyDeleteTest.php index f6e9154c..8c7b8a94 100644 --- a/tests/Predis/Command/KeyDeleteTest.php +++ b/tests/Predis/Command/KeyDeleteTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyDeleteTest extends CommandTestCase +class KeyDeleteTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyDumpTest.php b/tests/Predis/Command/KeyDumpTest.php index 621ffff7..ca572ec5 100644 --- a/tests/Predis/Command/KeyDumpTest.php +++ b/tests/Predis/Command/KeyDumpTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyDumpTest extends CommandTestCase +class KeyDumpTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyExistsTest.php b/tests/Predis/Command/KeyExistsTest.php index 581dc25b..1c435fbb 100644 --- a/tests/Predis/Command/KeyExistsTest.php +++ b/tests/Predis/Command/KeyExistsTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyExistsTest extends CommandTestCase +class KeyExistsTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyExpireAtTest.php b/tests/Predis/Command/KeyExpireAtTest.php index dbe69830..bf880621 100644 --- a/tests/Predis/Command/KeyExpireAtTest.php +++ b/tests/Predis/Command/KeyExpireAtTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyExpireAtTest extends CommandTestCase +class KeyExpireAtTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyExpireTest.php b/tests/Predis/Command/KeyExpireTest.php index 7af43532..07df416b 100644 --- a/tests/Predis/Command/KeyExpireTest.php +++ b/tests/Predis/Command/KeyExpireTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyExpireTest extends CommandTestCase +class KeyExpireTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyKeysTest.php b/tests/Predis/Command/KeyKeysTest.php index 0bed0fef..05bfe5e6 100644 --- a/tests/Predis/Command/KeyKeysTest.php +++ b/tests/Predis/Command/KeyKeysTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyKeysTest extends CommandTestCase +class KeyKeysTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyKeysV12xTest.php b/tests/Predis/Command/KeyKeysV12xTest.php index 10ebb187..b0286ce9 100644 --- a/tests/Predis/Command/KeyKeysV12xTest.php +++ b/tests/Predis/Command/KeyKeysV12xTest.php @@ -11,7 +11,7 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * We only perform disconnected tests for this commands because @@ -21,7 +21,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase; * @group commands * @group realm-key */ -class KeyKeysV12xTest extends CommandTestCase +class KeyKeysV12xTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyMoveTest.php b/tests/Predis/Command/KeyMoveTest.php index d1839329..200de300 100644 --- a/tests/Predis/Command/KeyMoveTest.php +++ b/tests/Predis/Command/KeyMoveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyMoveTest extends CommandTestCase +class KeyMoveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyPersistTest.php b/tests/Predis/Command/KeyPersistTest.php index 090a8986..1af204d5 100644 --- a/tests/Predis/Command/KeyPersistTest.php +++ b/tests/Predis/Command/KeyPersistTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyPersistTest extends CommandTestCase +class KeyPersistTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyPreciseExpireAtTest.php b/tests/Predis/Command/KeyPreciseExpireAtTest.php index 356ccaf6..74d1e103 100644 --- a/tests/Predis/Command/KeyPreciseExpireAtTest.php +++ b/tests/Predis/Command/KeyPreciseExpireAtTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyPreciseExpireAtTest extends CommandTestCase +class KeyPreciseExpireAtTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyPreciseExpireTest.php b/tests/Predis/Command/KeyPreciseExpireTest.php index 44dcb36b..4d05d9bc 100644 --- a/tests/Predis/Command/KeyPreciseExpireTest.php +++ b/tests/Predis/Command/KeyPreciseExpireTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyPreciseExpireTest extends CommandTestCase +class KeyPreciseExpireTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyPreciseTimeToLiveTest.php b/tests/Predis/Command/KeyPreciseTimeToLiveTest.php index 4b9266da..b5ed4645 100644 --- a/tests/Predis/Command/KeyPreciseTimeToLiveTest.php +++ b/tests/Predis/Command/KeyPreciseTimeToLiveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyPreciseTimeToLiveTest extends CommandTestCase +class KeyPreciseTimeToLiveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyRandomTest.php b/tests/Predis/Command/KeyRandomTest.php index ac29b2a1..3665534f 100644 --- a/tests/Predis/Command/KeyRandomTest.php +++ b/tests/Predis/Command/KeyRandomTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyRandomTest extends CommandTestCase +class KeyRandomTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyRenamePreserveTest.php b/tests/Predis/Command/KeyRenamePreserveTest.php index d467ff7c..04ec2649 100644 --- a/tests/Predis/Command/KeyRenamePreserveTest.php +++ b/tests/Predis/Command/KeyRenamePreserveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyRenamePreserveTest extends CommandTestCase +class KeyRenamePreserveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyRenameTest.php b/tests/Predis/Command/KeyRenameTest.php index e899d3b5..e2207ede 100644 --- a/tests/Predis/Command/KeyRenameTest.php +++ b/tests/Predis/Command/KeyRenameTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyRenameTest extends CommandTestCase +class KeyRenameTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyRestoreTest.php b/tests/Predis/Command/KeyRestoreTest.php index 4bd1582e..eed7682c 100644 --- a/tests/Predis/Command/KeyRestoreTest.php +++ b/tests/Predis/Command/KeyRestoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyRestoreTest extends CommandTestCase +class KeyRestoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyScanTest.php b/tests/Predis/Command/KeyScanTest.php index 63c3cca5..0508406b 100644 --- a/tests/Predis/Command/KeyScanTest.php +++ b/tests/Predis/Command/KeyScanTest.php @@ -11,13 +11,12 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyScanTest extends CommandTestCase +class KeyScanTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeySortTest.php b/tests/Predis/Command/KeySortTest.php index 8f6ac6f5..c94cc41a 100644 --- a/tests/Predis/Command/KeySortTest.php +++ b/tests/Predis/Command/KeySortTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeySortTest extends CommandTestCase +class KeySortTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyTimeToLiveTest.php b/tests/Predis/Command/KeyTimeToLiveTest.php index e3327e82..ea068eac 100644 --- a/tests/Predis/Command/KeyTimeToLiveTest.php +++ b/tests/Predis/Command/KeyTimeToLiveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyTimeToLiveTest extends CommandTestCase +class KeyTimeToLiveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/KeyTypeTest.php b/tests/Predis/Command/KeyTypeTest.php index 81d32b4e..c14fe294 100644 --- a/tests/Predis/Command/KeyTypeTest.php +++ b/tests/Predis/Command/KeyTypeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-key */ -class KeyTypeTest extends CommandTestCase +class KeyTypeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListIndexTest.php b/tests/Predis/Command/ListIndexTest.php index 3de7e751..7f5f75db 100644 --- a/tests/Predis/Command/ListIndexTest.php +++ b/tests/Predis/Command/ListIndexTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListIndexTest extends CommandTestCase +class ListIndexTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListInsertTest.php b/tests/Predis/Command/ListInsertTest.php index 2fd3c7e1..9cb6e185 100644 --- a/tests/Predis/Command/ListInsertTest.php +++ b/tests/Predis/Command/ListInsertTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListInsertTest extends CommandTestCase +class ListInsertTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListLengthTest.php b/tests/Predis/Command/ListLengthTest.php index b36e7478..7ff05508 100644 --- a/tests/Predis/Command/ListLengthTest.php +++ b/tests/Predis/Command/ListLengthTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListLengthTest extends CommandTestCase +class ListLengthTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPopFirstBlockingTest.php b/tests/Predis/Command/ListPopFirstBlockingTest.php index 080f82e7..79f36876 100644 --- a/tests/Predis/Command/ListPopFirstBlockingTest.php +++ b/tests/Predis/Command/ListPopFirstBlockingTest.php @@ -11,7 +11,7 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands @@ -19,7 +19,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase; * @todo Testing blocking pop operations against Redis using PHP is * tricky, so we will skip these kind of tests for now. */ -class ListPopFirstBlockingTest extends CommandTestCase +class ListPopFirstBlockingTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPopFirstTest.php b/tests/Predis/Command/ListPopFirstTest.php index c7a60069..0ef1c73b 100644 --- a/tests/Predis/Command/ListPopFirstTest.php +++ b/tests/Predis/Command/ListPopFirstTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListPopFirstTest extends CommandTestCase +class ListPopFirstTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPopLastBlockingTest.php b/tests/Predis/Command/ListPopLastBlockingTest.php index 63b3316b..c5817949 100644 --- a/tests/Predis/Command/ListPopLastBlockingTest.php +++ b/tests/Predis/Command/ListPopLastBlockingTest.php @@ -11,7 +11,7 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands @@ -19,7 +19,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase; * @todo Testing blocking pop operations against Redis using PHP is * tricky, so we will skip these kind of tests for now. */ -class ListPopLastBlockingTest extends CommandTestCase +class ListPopLastBlockingTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPopLastPushHeadBlockingTest.php b/tests/Predis/Command/ListPopLastPushHeadBlockingTest.php index ce2f5b7e..b0eaabd3 100644 --- a/tests/Predis/Command/ListPopLastPushHeadBlockingTest.php +++ b/tests/Predis/Command/ListPopLastPushHeadBlockingTest.php @@ -11,7 +11,7 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands @@ -19,7 +19,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase; * @todo Testing blocking pop operations against Redis using PHP is * tricky, so we will skip these kind of tests for now. */ -class ListPopLastPushHeadBlockingTest extends CommandTestCase +class ListPopLastPushHeadBlockingTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPopLastPushHeadTest.php b/tests/Predis/Command/ListPopLastPushHeadTest.php index 0df30cc5..dc3332c0 100644 --- a/tests/Predis/Command/ListPopLastPushHeadTest.php +++ b/tests/Predis/Command/ListPopLastPushHeadTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListPopLastPushHeadTest extends CommandTestCase +class ListPopLastPushHeadTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPopLastTest.php b/tests/Predis/Command/ListPopLastTest.php index 3a66d3e2..68c54b91 100644 --- a/tests/Predis/Command/ListPopLastTest.php +++ b/tests/Predis/Command/ListPopLastTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListPopLastTest extends CommandTestCase +class ListPopLastTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPushHeadTest.php b/tests/Predis/Command/ListPushHeadTest.php index 685bca2d..e855a2cc 100644 --- a/tests/Predis/Command/ListPushHeadTest.php +++ b/tests/Predis/Command/ListPushHeadTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListPushHeadTest extends CommandTestCase +class ListPushHeadTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPushHeadXTest.php b/tests/Predis/Command/ListPushHeadXTest.php index 67d9bdf1..3879bbe9 100644 --- a/tests/Predis/Command/ListPushHeadXTest.php +++ b/tests/Predis/Command/ListPushHeadXTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListPushHeadXTest extends CommandTestCase +class ListPushHeadXTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPushTailTest.php b/tests/Predis/Command/ListPushTailTest.php index 8f69bb03..8538de98 100644 --- a/tests/Predis/Command/ListPushTailTest.php +++ b/tests/Predis/Command/ListPushTailTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListPushTailTest extends CommandTestCase +class ListPushTailTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListPushTailXTest.php b/tests/Predis/Command/ListPushTailXTest.php index 4175de5c..e79e1698 100644 --- a/tests/Predis/Command/ListPushTailXTest.php +++ b/tests/Predis/Command/ListPushTailXTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListPushTailXTest extends CommandTestCase +class ListPushTailXTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListRangeTest.php b/tests/Predis/Command/ListRangeTest.php index ea6f5ef9..e74726b3 100644 --- a/tests/Predis/Command/ListRangeTest.php +++ b/tests/Predis/Command/ListRangeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListRangeTest extends CommandTestCase +class ListRangeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListRemoveTest.php b/tests/Predis/Command/ListRemoveTest.php index 32e23cb3..06586bb7 100644 --- a/tests/Predis/Command/ListRemoveTest.php +++ b/tests/Predis/Command/ListRemoveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListRemoveTest extends CommandTestCase +class ListRemoveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListSetTest.php b/tests/Predis/Command/ListSetTest.php index 124109d9..6a3225b8 100644 --- a/tests/Predis/Command/ListSetTest.php +++ b/tests/Predis/Command/ListSetTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListSetTest extends CommandTestCase +class ListSetTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ListTrimTest.php b/tests/Predis/Command/ListTrimTest.php index b543a630..3fe0f52f 100644 --- a/tests/Predis/Command/ListTrimTest.php +++ b/tests/Predis/Command/ListTrimTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-list */ -class ListTrimTest extends CommandTestCase +class ListTrimTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/PrefixHelpersTest.php b/tests/Predis/Command/PrefixHelpersTest.php index bb81c494..ae5a8d34 100644 --- a/tests/Predis/Command/PrefixHelpersTest.php +++ b/tests/Predis/Command/PrefixHelpersTest.php @@ -11,12 +11,12 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class PrefixHelpersTest extends StandardTestCase +class PrefixHelpersTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Command/PrefixableCommandTest.php b/tests/Predis/Command/PrefixableCommandTest.php index 8523e285..0da66628 100644 --- a/tests/Predis/Command/PrefixableCommandTest.php +++ b/tests/Predis/Command/PrefixableCommandTest.php @@ -11,12 +11,12 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class PrefixableCommandTest extends StandardTestCase +class PrefixableCommandTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php index 16f31946..10c3fd9b 100644 --- a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php +++ b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php @@ -11,12 +11,12 @@ namespace Predis\Command\Processor; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class KeyPrefixProcessorTest extends StandardTestCase +class KeyPrefixProcessorTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Command/Processor/ProcessorChainTest.php b/tests/Predis/Command/Processor/ProcessorChainTest.php index 8c793e2c..55264f5f 100644 --- a/tests/Predis/Command/Processor/ProcessorChainTest.php +++ b/tests/Predis/Command/Processor/ProcessorChainTest.php @@ -11,12 +11,12 @@ namespace Predis\Command\Processor; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ProcessorChainTest extends StandardTestCase +class ProcessorChainTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Command/PubSubPublishTest.php b/tests/Predis/Command/PubSubPublishTest.php index 69d3f595..922e8503 100644 --- a/tests/Predis/Command/PubSubPublishTest.php +++ b/tests/Predis/Command/PubSubPublishTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-pubsub */ -class PubSubPublishTest extends CommandTestCase +class PubSubPublishTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/PubSubSubscribeByPatternTest.php b/tests/Predis/Command/PubSubSubscribeByPatternTest.php index 94c1a8e6..61dd4cb4 100644 --- a/tests/Predis/Command/PubSubSubscribeByPatternTest.php +++ b/tests/Predis/Command/PubSubSubscribeByPatternTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-pubsub */ -class PubSubSubscribeByPatternTest extends CommandTestCase +class PubSubSubscribeByPatternTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/PubSubSubscribeTest.php b/tests/Predis/Command/PubSubSubscribeTest.php index 3c424d49..e74bc3d8 100644 --- a/tests/Predis/Command/PubSubSubscribeTest.php +++ b/tests/Predis/Command/PubSubSubscribeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-pubsub */ -class PubSubSubscribeTest extends CommandTestCase +class PubSubSubscribeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/PubSubUnsubscribeByPatternTest.php b/tests/Predis/Command/PubSubUnsubscribeByPatternTest.php index 4a1be3a7..c9cf2bf9 100644 --- a/tests/Predis/Command/PubSubUnsubscribeByPatternTest.php +++ b/tests/Predis/Command/PubSubUnsubscribeByPatternTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-pubsub */ -class PubSubUnsubscribeByPatternTest extends CommandTestCase +class PubSubUnsubscribeByPatternTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/PubSubUnsubscribeTest.php b/tests/Predis/Command/PubSubUnsubscribeTest.php index b2fd6415..9f0e9d76 100644 --- a/tests/Predis/Command/PubSubUnsubscribeTest.php +++ b/tests/Predis/Command/PubSubUnsubscribeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-pubsub */ -class PubSubUnsubscribeTest extends CommandTestCase +class PubSubUnsubscribeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/RawCommandTest.php b/tests/Predis/Command/RawCommandTest.php index 9c683ef6..f16df67e 100644 --- a/tests/Predis/Command/RawCommandTest.php +++ b/tests/Predis/Command/RawCommandTest.php @@ -11,12 +11,12 @@ namespace Predis\Command; -use PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class RawCommandTest extends StandardTestCase +class RawCommandTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Command/ScriptedCommandTest.php b/tests/Predis/Command/ScriptedCommandTest.php index 95c31447..3680d8e3 100644 --- a/tests/Predis/Command/ScriptedCommandTest.php +++ b/tests/Predis/Command/ScriptedCommandTest.php @@ -11,12 +11,12 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group realm-scripting */ -class ScriptedCommandTest extends StandardTestCase +class ScriptedCommandTest extends PredisTestCase { const LUA_SCRIPT = 'return { KEYS[1], KEYS[2], ARGV[1], ARGV[2] }'; const LUA_SCRIPT_SHA1 = '6e07f61f502e36d123fe28523076af588f5c315e'; diff --git a/tests/Predis/Command/ServerBackgroundRewriteAOFTest.php b/tests/Predis/Command/ServerBackgroundRewriteAOFTest.php index 4fee52f8..dd9c9d5f 100644 --- a/tests/Predis/Command/ServerBackgroundRewriteAOFTest.php +++ b/tests/Predis/Command/ServerBackgroundRewriteAOFTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerBackgroundRewriteAOFTest extends CommandTestCase +class ServerBackgroundRewriteAOFTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerBackgroundSaveTest.php b/tests/Predis/Command/ServerBackgroundSaveTest.php index 0bf7be01..b18ba16a 100644 --- a/tests/Predis/Command/ServerBackgroundSaveTest.php +++ b/tests/Predis/Command/ServerBackgroundSaveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerBackgroundSaveTest extends CommandTestCase +class ServerBackgroundSaveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerClientTest.php b/tests/Predis/Command/ServerClientTest.php index b45e9d9b..7641ae2a 100644 --- a/tests/Predis/Command/ServerClientTest.php +++ b/tests/Predis/Command/ServerClientTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerClientTest extends CommandTestCase +class ServerClientTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerConfigTest.php b/tests/Predis/Command/ServerConfigTest.php index bbd3f14f..542690b5 100644 --- a/tests/Predis/Command/ServerConfigTest.php +++ b/tests/Predis/Command/ServerConfigTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerConfigTest extends CommandTestCase +class ServerConfigTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerDatabaseSizeTest.php b/tests/Predis/Command/ServerDatabaseSizeTest.php index fb889f74..6041dfab 100644 --- a/tests/Predis/Command/ServerDatabaseSizeTest.php +++ b/tests/Predis/Command/ServerDatabaseSizeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerDatabaseSizeTest extends CommandTestCase +class ServerDatabaseSizeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerEvalSHATest.php b/tests/Predis/Command/ServerEvalSHATest.php index d777db0c..10043504 100644 --- a/tests/Predis/Command/ServerEvalSHATest.php +++ b/tests/Predis/Command/ServerEvalSHATest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-scripting */ -class ServerEvalSHATest extends CommandTestCase +class ServerEvalSHATest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerEvalTest.php b/tests/Predis/Command/ServerEvalTest.php index 5aebf6ee..3fce4123 100644 --- a/tests/Predis/Command/ServerEvalTest.php +++ b/tests/Predis/Command/ServerEvalTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-scripting */ -class ServerEvalTest extends CommandTestCase +class ServerEvalTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerFlushAllTest.php b/tests/Predis/Command/ServerFlushAllTest.php index 090d33f9..7e0c8845 100644 --- a/tests/Predis/Command/ServerFlushAllTest.php +++ b/tests/Predis/Command/ServerFlushAllTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerFlushAllTest extends CommandTestCase +class ServerFlushAllTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerFlushDatabaseTest.php b/tests/Predis/Command/ServerFlushDatabaseTest.php index 39ae5738..861b0c4a 100644 --- a/tests/Predis/Command/ServerFlushDatabaseTest.php +++ b/tests/Predis/Command/ServerFlushDatabaseTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerFlushDatabaseTest extends CommandTestCase +class ServerFlushDatabaseTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerInfoTest.php b/tests/Predis/Command/ServerInfoTest.php index 2b9b2038..925880ea 100644 --- a/tests/Predis/Command/ServerInfoTest.php +++ b/tests/Predis/Command/ServerInfoTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerInfoTest extends CommandTestCase +class ServerInfoTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerInfoV26xTest.php b/tests/Predis/Command/ServerInfoV26xTest.php index 76f75c76..d50c69c4 100644 --- a/tests/Predis/Command/ServerInfoV26xTest.php +++ b/tests/Predis/Command/ServerInfoV26xTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerInfoV26xTest extends CommandTestCase +class ServerInfoV26xTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerLastSaveTest.php b/tests/Predis/Command/ServerLastSaveTest.php index 15bedf05..b6e070cb 100644 --- a/tests/Predis/Command/ServerLastSaveTest.php +++ b/tests/Predis/Command/ServerLastSaveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerLastSaveTest extends CommandTestCase +class ServerLastSaveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerMonitorTest.php b/tests/Predis/Command/ServerMonitorTest.php index cab231c9..bfae3337 100644 --- a/tests/Predis/Command/ServerMonitorTest.php +++ b/tests/Predis/Command/ServerMonitorTest.php @@ -11,14 +11,14 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server * @group realm-monitor */ -class ServerMonitorTest extends CommandTestCase +class ServerMonitorTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerObjectTest.php b/tests/Predis/Command/ServerObjectTest.php index aea730fa..eb06cdc1 100644 --- a/tests/Predis/Command/ServerObjectTest.php +++ b/tests/Predis/Command/ServerObjectTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerObjectTest extends CommandTestCase +class ServerObjectTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerSaveTest.php b/tests/Predis/Command/ServerSaveTest.php index 0be9647c..ab93b4b1 100644 --- a/tests/Predis/Command/ServerSaveTest.php +++ b/tests/Predis/Command/ServerSaveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerSaveTest extends CommandTestCase +class ServerSaveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerScriptTest.php b/tests/Predis/Command/ServerScriptTest.php index 9d69f5c7..3607e44b 100644 --- a/tests/Predis/Command/ServerScriptTest.php +++ b/tests/Predis/Command/ServerScriptTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-scripting */ -class ServerScriptTest extends CommandTestCase +class ServerScriptTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerShutdownTest.php b/tests/Predis/Command/ServerShutdownTest.php index 13f4fcf0..0eccba1d 100644 --- a/tests/Predis/Command/ServerShutdownTest.php +++ b/tests/Predis/Command/ServerShutdownTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerShutdownTest extends CommandTestCase +class ServerShutdownTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerSlaveOfTest.php b/tests/Predis/Command/ServerSlaveOfTest.php index e65d1b76..13c643f0 100644 --- a/tests/Predis/Command/ServerSlaveOfTest.php +++ b/tests/Predis/Command/ServerSlaveOfTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerSlaveOfTest extends CommandTestCase +class ServerSlaveOfTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerSlowlogTest.php b/tests/Predis/Command/ServerSlowlogTest.php index 64ab9497..d557aced 100644 --- a/tests/Predis/Command/ServerSlowlogTest.php +++ b/tests/Predis/Command/ServerSlowlogTest.php @@ -11,7 +11,7 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * In order to support the output of SLOWLOG, the backend connection @@ -20,7 +20,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase; * @group commands * @group realm-server */ -class ServerSlowlogTest extends CommandTestCase +class ServerSlowlogTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ServerTimeTest.php b/tests/Predis/Command/ServerTimeTest.php index 19e313d6..a4671e5c 100644 --- a/tests/Predis/Command/ServerTimeTest.php +++ b/tests/Predis/Command/ServerTimeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-server */ -class ServerTimeTest extends CommandTestCase +class ServerTimeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetAddTest.php b/tests/Predis/Command/SetAddTest.php index 6452cb9a..85f540b1 100644 --- a/tests/Predis/Command/SetAddTest.php +++ b/tests/Predis/Command/SetAddTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetAddTest extends CommandTestCase +class SetAddTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetCardinalityTest.php b/tests/Predis/Command/SetCardinalityTest.php index 5a806263..9d40b2ad 100644 --- a/tests/Predis/Command/SetCardinalityTest.php +++ b/tests/Predis/Command/SetCardinalityTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetCardinalityTest extends CommandTestCase +class SetCardinalityTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetDifferenceStoreTest.php b/tests/Predis/Command/SetDifferenceStoreTest.php index b575f38a..18737bda 100644 --- a/tests/Predis/Command/SetDifferenceStoreTest.php +++ b/tests/Predis/Command/SetDifferenceStoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetDifferenceStoreTest extends CommandTestCase +class SetDifferenceStoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetDifferenceTest.php b/tests/Predis/Command/SetDifferenceTest.php index e8318f13..98c7ae4e 100644 --- a/tests/Predis/Command/SetDifferenceTest.php +++ b/tests/Predis/Command/SetDifferenceTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetDifferenceTest extends CommandTestCase +class SetDifferenceTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetIntersectionStoreTest.php b/tests/Predis/Command/SetIntersectionStoreTest.php index cd68398a..23c28988 100644 --- a/tests/Predis/Command/SetIntersectionStoreTest.php +++ b/tests/Predis/Command/SetIntersectionStoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetIntersectionStoreTest extends CommandTestCase +class SetIntersectionStoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetIntersectionTest.php b/tests/Predis/Command/SetIntersectionTest.php index f9f4c164..2a284a53 100644 --- a/tests/Predis/Command/SetIntersectionTest.php +++ b/tests/Predis/Command/SetIntersectionTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetIntersectionTest extends CommandTestCase +class SetIntersectionTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetIsMemberTest.php b/tests/Predis/Command/SetIsMemberTest.php index 30c5e0ae..fa87c4cb 100644 --- a/tests/Predis/Command/SetIsMemberTest.php +++ b/tests/Predis/Command/SetIsMemberTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetIsMemberTest extends CommandTestCase +class SetIsMemberTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetMembersTest.php b/tests/Predis/Command/SetMembersTest.php index 2d8cc4be..d9e76006 100644 --- a/tests/Predis/Command/SetMembersTest.php +++ b/tests/Predis/Command/SetMembersTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetMembersTest extends CommandTestCase +class SetMembersTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetMoveTest.php b/tests/Predis/Command/SetMoveTest.php index dda704dd..84bbf220 100644 --- a/tests/Predis/Command/SetMoveTest.php +++ b/tests/Predis/Command/SetMoveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetMoveTest extends CommandTestCase +class SetMoveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetPopTest.php b/tests/Predis/Command/SetPopTest.php index a72bbf0a..720f7e71 100644 --- a/tests/Predis/Command/SetPopTest.php +++ b/tests/Predis/Command/SetPopTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetPopTest extends CommandTestCase +class SetPopTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetRandomMemberTest.php b/tests/Predis/Command/SetRandomMemberTest.php index a1ed9674..f799fb99 100644 --- a/tests/Predis/Command/SetRandomMemberTest.php +++ b/tests/Predis/Command/SetRandomMemberTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetRandomMemberTest extends CommandTestCase +class SetRandomMemberTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetRemoveTest.php b/tests/Predis/Command/SetRemoveTest.php index ed6e20c8..91014496 100644 --- a/tests/Predis/Command/SetRemoveTest.php +++ b/tests/Predis/Command/SetRemoveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetRemoveTest extends CommandTestCase +class SetRemoveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetScanTest.php b/tests/Predis/Command/SetScanTest.php index 6ef6eda7..8e43c105 100644 --- a/tests/Predis/Command/SetScanTest.php +++ b/tests/Predis/Command/SetScanTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetScanTest extends CommandTestCase +class SetScanTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetUnionStoreTest.php b/tests/Predis/Command/SetUnionStoreTest.php index 9c76d10f..4a876c65 100644 --- a/tests/Predis/Command/SetUnionStoreTest.php +++ b/tests/Predis/Command/SetUnionStoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetUnionStoreTest extends CommandTestCase +class SetUnionStoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/SetUnionTest.php b/tests/Predis/Command/SetUnionTest.php index 5f936347..a2167641 100644 --- a/tests/Predis/Command/SetUnionTest.php +++ b/tests/Predis/Command/SetUnionTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-set */ -class SetUnionTest extends CommandTestCase +class SetUnionTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringAppendTest.php b/tests/Predis/Command/StringAppendTest.php index 847981ce..993b62f2 100644 --- a/tests/Predis/Command/StringAppendTest.php +++ b/tests/Predis/Command/StringAppendTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringAppendTest extends CommandTestCase +class StringAppendTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringBitCountTest.php b/tests/Predis/Command/StringBitCountTest.php index 82ac0dac..4f6a4343 100644 --- a/tests/Predis/Command/StringBitCountTest.php +++ b/tests/Predis/Command/StringBitCountTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringBitCountTest extends CommandTestCase +class StringBitCountTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringBitOpTest.php b/tests/Predis/Command/StringBitOpTest.php index dacf4b41..9d0f5632 100644 --- a/tests/Predis/Command/StringBitOpTest.php +++ b/tests/Predis/Command/StringBitOpTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringBitOpTest extends CommandTestCase +class StringBitOpTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringDecrementByTest.php b/tests/Predis/Command/StringDecrementByTest.php index a21c9690..bdb072ab 100644 --- a/tests/Predis/Command/StringDecrementByTest.php +++ b/tests/Predis/Command/StringDecrementByTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringDecrementByTest extends CommandTestCase +class StringDecrementByTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringDecrementTest.php b/tests/Predis/Command/StringDecrementTest.php index 080be9f1..448c721d 100644 --- a/tests/Predis/Command/StringDecrementTest.php +++ b/tests/Predis/Command/StringDecrementTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringDecrementTest extends CommandTestCase +class StringDecrementTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringGetBitTest.php b/tests/Predis/Command/StringGetBitTest.php index e945d263..8b93a164 100644 --- a/tests/Predis/Command/StringGetBitTest.php +++ b/tests/Predis/Command/StringGetBitTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringGetBitTest extends CommandTestCase +class StringGetBitTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringGetMultipleTest.php b/tests/Predis/Command/StringGetMultipleTest.php index f1d7a887..6718be8d 100644 --- a/tests/Predis/Command/StringGetMultipleTest.php +++ b/tests/Predis/Command/StringGetMultipleTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringGetMultipleTest extends CommandTestCase +class StringGetMultipleTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringGetRangeTest.php b/tests/Predis/Command/StringGetRangeTest.php index 3f0f74cb..487ec51f 100644 --- a/tests/Predis/Command/StringGetRangeTest.php +++ b/tests/Predis/Command/StringGetRangeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringGetRangeTest extends CommandTestCase +class StringGetRangeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringGetSetTest.php b/tests/Predis/Command/StringGetSetTest.php index d151fda8..969e22ba 100644 --- a/tests/Predis/Command/StringGetSetTest.php +++ b/tests/Predis/Command/StringGetSetTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringGetSetTest extends CommandTestCase +class StringGetSetTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringGetTest.php b/tests/Predis/Command/StringGetTest.php index 7233e229..589fe115 100644 --- a/tests/Predis/Command/StringGetTest.php +++ b/tests/Predis/Command/StringGetTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringGetTest extends CommandTestCase +class StringGetTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringIncrementByFloatTest.php b/tests/Predis/Command/StringIncrementByFloatTest.php index f3d0dc73..efc445bf 100644 --- a/tests/Predis/Command/StringIncrementByFloatTest.php +++ b/tests/Predis/Command/StringIncrementByFloatTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringIncrementByFloatTest extends CommandTestCase +class StringIncrementByFloatTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringIncrementByTest.php b/tests/Predis/Command/StringIncrementByTest.php index 711d377c..25f561bb 100644 --- a/tests/Predis/Command/StringIncrementByTest.php +++ b/tests/Predis/Command/StringIncrementByTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringIncrementByTest extends CommandTestCase +class StringIncrementByTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringIncrementTest.php b/tests/Predis/Command/StringIncrementTest.php index 6e2a1fb0..61ad7afd 100644 --- a/tests/Predis/Command/StringIncrementTest.php +++ b/tests/Predis/Command/StringIncrementTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringIncrementTest extends CommandTestCase +class StringIncrementTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringPreciseSetExpireTest.php b/tests/Predis/Command/StringPreciseSetExpireTest.php index 5ce521f7..451f7502 100644 --- a/tests/Predis/Command/StringPreciseSetExpireTest.php +++ b/tests/Predis/Command/StringPreciseSetExpireTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringPreciseSetExpireTest extends CommandTestCase +class StringPreciseSetExpireTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringSetBitTest.php b/tests/Predis/Command/StringSetBitTest.php index 1c1aceef..0fb8cd91 100644 --- a/tests/Predis/Command/StringSetBitTest.php +++ b/tests/Predis/Command/StringSetBitTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringSetBitTest extends CommandTestCase +class StringSetBitTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringSetExpireTest.php b/tests/Predis/Command/StringSetExpireTest.php index 7cc31253..190c4bca 100644 --- a/tests/Predis/Command/StringSetExpireTest.php +++ b/tests/Predis/Command/StringSetExpireTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringSetExpireTest extends CommandTestCase +class StringSetExpireTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringSetMultiplePreserveTest.php b/tests/Predis/Command/StringSetMultiplePreserveTest.php index d2833e35..11c973a3 100644 --- a/tests/Predis/Command/StringSetMultiplePreserveTest.php +++ b/tests/Predis/Command/StringSetMultiplePreserveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringSetMultiplePreserveTest extends CommandTestCase +class StringSetMultiplePreserveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringSetMultipleTest.php b/tests/Predis/Command/StringSetMultipleTest.php index f351aa41..72991d66 100644 --- a/tests/Predis/Command/StringSetMultipleTest.php +++ b/tests/Predis/Command/StringSetMultipleTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringSetMultipleTest extends CommandTestCase +class StringSetMultipleTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringSetPreserveTest.php b/tests/Predis/Command/StringSetPreserveTest.php index eac98fcd..e998d947 100644 --- a/tests/Predis/Command/StringSetPreserveTest.php +++ b/tests/Predis/Command/StringSetPreserveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringSetPreserveTest extends CommandTestCase +class StringSetPreserveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringSetRangeTest.php b/tests/Predis/Command/StringSetRangeTest.php index e5b70c20..ea2e06ca 100644 --- a/tests/Predis/Command/StringSetRangeTest.php +++ b/tests/Predis/Command/StringSetRangeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringSetRangeTest extends CommandTestCase +class StringSetRangeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringSetTest.php b/tests/Predis/Command/StringSetTest.php index 004ae0fe..e59508f9 100644 --- a/tests/Predis/Command/StringSetTest.php +++ b/tests/Predis/Command/StringSetTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringSetTest extends CommandTestCase +class StringSetTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringStrlenTest.php b/tests/Predis/Command/StringStrlenTest.php index 947e3e11..6ac166e8 100644 --- a/tests/Predis/Command/StringStrlenTest.php +++ b/tests/Predis/Command/StringStrlenTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-string */ -class StringStrlenTest extends CommandTestCase +class StringStrlenTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/StringSubstrTest.php b/tests/Predis/Command/StringSubstrTest.php index 2a7a204a..a5d42d27 100644 --- a/tests/Predis/Command/StringSubstrTest.php +++ b/tests/Predis/Command/StringSubstrTest.php @@ -11,7 +11,7 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * SUBSTR is actually the old name of GETRANGE in version of Redis <= 2.0. @@ -21,7 +21,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase; * @group commands * @group realm-string */ -class StringSubstrTest extends CommandTestCase +class StringSubstrTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/TransactionDiscardTest.php b/tests/Predis/Command/TransactionDiscardTest.php index 20fa9662..90e8efc5 100644 --- a/tests/Predis/Command/TransactionDiscardTest.php +++ b/tests/Predis/Command/TransactionDiscardTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-transaction */ -class TransactionDiscardTest extends CommandTestCase +class TransactionDiscardTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/TransactionExecTest.php b/tests/Predis/Command/TransactionExecTest.php index fd09ddda..bc248723 100644 --- a/tests/Predis/Command/TransactionExecTest.php +++ b/tests/Predis/Command/TransactionExecTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-transaction */ -class TransactionExecTest extends CommandTestCase +class TransactionExecTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/TransactionMultiTest.php b/tests/Predis/Command/TransactionMultiTest.php index 78bfe633..d9c853b8 100644 --- a/tests/Predis/Command/TransactionMultiTest.php +++ b/tests/Predis/Command/TransactionMultiTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-transaction */ -class TransactionMultiTest extends CommandTestCase +class TransactionMultiTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/TransactionUnwatchTest.php b/tests/Predis/Command/TransactionUnwatchTest.php index c1f8f1f7..b86bb875 100644 --- a/tests/Predis/Command/TransactionUnwatchTest.php +++ b/tests/Predis/Command/TransactionUnwatchTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-transaction */ -class TransactionUnwatchTest extends CommandTestCase +class TransactionUnwatchTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/TransactionWatchTest.php b/tests/Predis/Command/TransactionWatchTest.php index b98673ce..09fde252 100644 --- a/tests/Predis/Command/TransactionWatchTest.php +++ b/tests/Predis/Command/TransactionWatchTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-transaction */ -class TransactionWatchTest extends CommandTestCase +class TransactionWatchTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetAddTest.php b/tests/Predis/Command/ZSetAddTest.php index 74394423..c843d00f 100644 --- a/tests/Predis/Command/ZSetAddTest.php +++ b/tests/Predis/Command/ZSetAddTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetAddTest extends CommandTestCase +class ZSetAddTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetCardinalityTest.php b/tests/Predis/Command/ZSetCardinalityTest.php index 272286f7..00bc5b43 100644 --- a/tests/Predis/Command/ZSetCardinalityTest.php +++ b/tests/Predis/Command/ZSetCardinalityTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetCardinalityTest extends CommandTestCase +class ZSetCardinalityTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetCountTest.php b/tests/Predis/Command/ZSetCountTest.php index 19c288c4..9b6f41f8 100644 --- a/tests/Predis/Command/ZSetCountTest.php +++ b/tests/Predis/Command/ZSetCountTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetCountTest extends CommandTestCase +class ZSetCountTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetIncrementByTest.php b/tests/Predis/Command/ZSetIncrementByTest.php index 45fe321f..6d6c2604 100644 --- a/tests/Predis/Command/ZSetIncrementByTest.php +++ b/tests/Predis/Command/ZSetIncrementByTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetIncrementByTest extends CommandTestCase +class ZSetIncrementByTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetIntersectionStoreTest.php b/tests/Predis/Command/ZSetIntersectionStoreTest.php index 084b661f..ab021372 100644 --- a/tests/Predis/Command/ZSetIntersectionStoreTest.php +++ b/tests/Predis/Command/ZSetIntersectionStoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetIntersectionStoreTest extends CommandTestCase +class ZSetIntersectionStoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetRangeByScoreTest.php b/tests/Predis/Command/ZSetRangeByScoreTest.php index 37110df7..9639bb3d 100644 --- a/tests/Predis/Command/ZSetRangeByScoreTest.php +++ b/tests/Predis/Command/ZSetRangeByScoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetRangeByScoreTest extends CommandTestCase +class ZSetRangeByScoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetRangeTest.php b/tests/Predis/Command/ZSetRangeTest.php index 4ef10b6f..14fa3b88 100644 --- a/tests/Predis/Command/ZSetRangeTest.php +++ b/tests/Predis/Command/ZSetRangeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetRangeTest extends CommandTestCase +class ZSetRangeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetRankTest.php b/tests/Predis/Command/ZSetRankTest.php index 4070a262..cf985ca9 100644 --- a/tests/Predis/Command/ZSetRankTest.php +++ b/tests/Predis/Command/ZSetRankTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetRankTest extends CommandTestCase +class ZSetRankTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetRemoveRangeByRankTest.php b/tests/Predis/Command/ZSetRemoveRangeByRankTest.php index 01499b59..887f759b 100644 --- a/tests/Predis/Command/ZSetRemoveRangeByRankTest.php +++ b/tests/Predis/Command/ZSetRemoveRangeByRankTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetRemoveRangeByRankTest extends CommandTestCase +class ZSetRemoveRangeByRankTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetRemoveRangeByScoreTest.php b/tests/Predis/Command/ZSetRemoveRangeByScoreTest.php index 3e145a3e..d9b5d3dc 100644 --- a/tests/Predis/Command/ZSetRemoveRangeByScoreTest.php +++ b/tests/Predis/Command/ZSetRemoveRangeByScoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetRemoveRangeByScoreTest extends CommandTestCase +class ZSetRemoveRangeByScoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetRemoveTest.php b/tests/Predis/Command/ZSetRemoveTest.php index 0fe8ae8d..66e2607d 100644 --- a/tests/Predis/Command/ZSetRemoveTest.php +++ b/tests/Predis/Command/ZSetRemoveTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetRemoveTest extends CommandTestCase +class ZSetRemoveTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetReverseRangeByScoreTest.php b/tests/Predis/Command/ZSetReverseRangeByScoreTest.php index 6cfaa862..fcd34819 100644 --- a/tests/Predis/Command/ZSetReverseRangeByScoreTest.php +++ b/tests/Predis/Command/ZSetReverseRangeByScoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetReverseRangeByScoreTest extends CommandTestCase +class ZSetReverseRangeByScoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetReverseRangeTest.php b/tests/Predis/Command/ZSetReverseRangeTest.php index 58b17dd6..f8ac8b02 100644 --- a/tests/Predis/Command/ZSetReverseRangeTest.php +++ b/tests/Predis/Command/ZSetReverseRangeTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetReverseRangeTest extends CommandTestCase +class ZSetReverseRangeTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetReverseRankTest.php b/tests/Predis/Command/ZSetReverseRankTest.php index 10434d5b..13bf0851 100644 --- a/tests/Predis/Command/ZSetReverseRankTest.php +++ b/tests/Predis/Command/ZSetReverseRankTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetReverseRankTest extends CommandTestCase +class ZSetReverseRankTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetScanTest.php b/tests/Predis/Command/ZSetScanTest.php index 918afe14..984b5b07 100644 --- a/tests/Predis/Command/ZSetScanTest.php +++ b/tests/Predis/Command/ZSetScanTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetScanTest extends CommandTestCase +class ZSetScanTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetScoreTest.php b/tests/Predis/Command/ZSetScoreTest.php index 929a4278..87bd93a3 100644 --- a/tests/Predis/Command/ZSetScoreTest.php +++ b/tests/Predis/Command/ZSetScoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetScoreTest extends CommandTestCase +class ZSetScoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/Command/ZSetUnionStoreTest.php b/tests/Predis/Command/ZSetUnionStoreTest.php index 2569c0c2..4c130f74 100644 --- a/tests/Predis/Command/ZSetUnionStoreTest.php +++ b/tests/Predis/Command/ZSetUnionStoreTest.php @@ -11,13 +11,13 @@ namespace Predis\Command; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @group commands * @group realm-zset */ -class ZSetUnionStoreTest extends CommandTestCase +class ZSetUnionStoreTest extends PredisCommandTestCase { /** * {@inheritdoc} diff --git a/tests/Predis/CommunicationExceptionTest.php b/tests/Predis/CommunicationExceptionTest.php index b4c2ccde..76f4d02e 100644 --- a/tests/Predis/CommunicationExceptionTest.php +++ b/tests/Predis/CommunicationExceptionTest.php @@ -11,14 +11,13 @@ namespace Predis; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Connection\SingleConnectionInterface; /** * */ -class CommunicationExceptionTest extends StandardTestCase +class CommunicationExceptionTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Connection/ComposableStreamConnectionTest.php b/tests/Predis/Connection/ComposableStreamConnectionTest.php index d21b7549..679f2d1d 100644 --- a/tests/Predis/Connection/ComposableStreamConnectionTest.php +++ b/tests/Predis/Connection/ComposableStreamConnectionTest.php @@ -11,14 +11,13 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Profile\ServerProfile; /** * */ -class ComposableStreamConnectionTest extends ConnectionTestCase +class ComposableStreamConnectionTest extends PredisConnectionTestCase { /** * @group disconnected diff --git a/tests/Predis/Connection/ConnectionFactoryTest.php b/tests/Predis/Connection/ConnectionFactoryTest.php index 99867d9d..9fdeda82 100644 --- a/tests/Predis/Connection/ConnectionFactoryTest.php +++ b/tests/Predis/Connection/ConnectionFactoryTest.php @@ -11,12 +11,11 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; /** * */ -class ConnectionFactoryTest extends StandardTestCase +class ConnectionFactoryTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Connection/ConnectionParametersTest.php b/tests/Predis/Connection/ConnectionParametersTest.php index d5a95e63..33b8bb5d 100644 --- a/tests/Predis/Connection/ConnectionParametersTest.php +++ b/tests/Predis/Connection/ConnectionParametersTest.php @@ -11,13 +11,12 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; /** * @todo ConnectionParameters::define(); * @todo ConnectionParameters::undefine(); */ -class ParametersTest extends StandardTestCase +class ParametersTest extends PredisTestCase { /** * @group disconnected @@ -188,18 +187,6 @@ class ParametersTest extends StandardTestCase ); } - /** - * 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. * diff --git a/tests/Predis/Connection/MasterSlaveReplicationTest.php b/tests/Predis/Connection/MasterSlaveReplicationTest.php index 5acf0d77..e90a100b 100644 --- a/tests/Predis/Connection/MasterSlaveReplicationTest.php +++ b/tests/Predis/Connection/MasterSlaveReplicationTest.php @@ -11,15 +11,14 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Profile\ServerProfile; use Predis\Replication\ReplicationStrategy; /** * */ -class MasterSlaveReplicationTest extends StandardTestCase +class MasterSlaveReplicationTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Connection/PhpiredisConnectionTest.php b/tests/Predis/Connection/PhpiredisConnectionTest.php index 2ab89099..16f43074 100644 --- a/tests/Predis/Connection/PhpiredisConnectionTest.php +++ b/tests/Predis/Connection/PhpiredisConnectionTest.php @@ -11,14 +11,13 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Profile\ServerProfile; /** * @group ext-phpiredis */ -class PhpiredisConnectionTest extends ConnectionTestCase +class PhpiredisConnectionTest extends PredisConnectionTestCase { /** * @group disconnected diff --git a/tests/Predis/Connection/PhpiredisStreamConnectionTest.php b/tests/Predis/Connection/PhpiredisStreamConnectionTest.php index 11701397..1d28f8da 100644 --- a/tests/Predis/Connection/PhpiredisStreamConnectionTest.php +++ b/tests/Predis/Connection/PhpiredisStreamConnectionTest.php @@ -11,14 +11,13 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Profile\ServerProfile; /** * @group ext-phpiredis */ -class PhpiredisStreamConnectionTest extends ConnectionTestCase +class PhpiredisStreamConnectionTest extends PredisConnectionTestCase { /** * @group disconnected @@ -109,6 +108,7 @@ class PhpiredisStreamConnectionTest extends ConnectionTestCase } /** + * @medium * @group connected * @expectedException Predis\Protocol\ProtocolException * @expectedExceptionMessage Protocol error, got "P" as reply type byte diff --git a/tests/Predis/Connection/PredisClusterTest.php b/tests/Predis/Connection/PredisClusterTest.php index 01d24dcb..88e3e2df 100644 --- a/tests/Predis/Connection/PredisClusterTest.php +++ b/tests/Predis/Connection/PredisClusterTest.php @@ -11,14 +11,13 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Profile\ServerProfile; /** * */ -class PredisClusterTest extends StandardTestCase +class PredisClusterTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Connection/RedisClusterTest.php b/tests/Predis/Connection/RedisClusterTest.php index 0d63e5c9..93584055 100644 --- a/tests/Predis/Connection/RedisClusterTest.php +++ b/tests/Predis/Connection/RedisClusterTest.php @@ -11,15 +11,14 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\ResponseError; use Predis\Profile\ServerProfile; /** * */ -class RedisClusterTest extends StandardTestCase +class RedisClusterTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Connection/StreamConnectionTest.php b/tests/Predis/Connection/StreamConnectionTest.php index 251dc3c3..cb6d5b61 100644 --- a/tests/Predis/Connection/StreamConnectionTest.php +++ b/tests/Predis/Connection/StreamConnectionTest.php @@ -11,14 +11,13 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Profile\ServerProfile; /** * */ -class StreamConnectionTest extends ConnectionTestCase +class StreamConnectionTest extends PredisConnectionTestCase { /** * @group disconnected diff --git a/tests/Predis/Connection/WebdisConnectionTest.php b/tests/Predis/Connection/WebdisConnectionTest.php index 758fd027..97771153 100644 --- a/tests/Predis/Connection/WebdisConnectionTest.php +++ b/tests/Predis/Connection/WebdisConnectionTest.php @@ -11,8 +11,7 @@ namespace Predis\Connection; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Profile\ServerProfile; /** @@ -21,7 +20,7 @@ use Predis\Profile\ServerProfile; * @group realm-connection * @group realm-webdis */ -class WebdisConnectionTest extends StandardTestCase +class WebdisConnectionTest extends PredisTestCase { /** * @group disconnected @@ -167,31 +166,6 @@ class WebdisConnectionTest 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 ServerProfile - */ - protected function getProfile($version = null) - { - return ServerProfile::get($version ?: REDIS_SERVER_VERSION); - } - /** * Returns a new instance of a connection instance. * diff --git a/tests/Predis/HelpersTest.php b/tests/Predis/HelpersTest.php index dbceb67e..ac69b7b0 100644 --- a/tests/Predis/HelpersTest.php +++ b/tests/Predis/HelpersTest.php @@ -11,12 +11,12 @@ namespace Predis; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class HelpersTest extends StandardTestCase +class HelpersTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Iterator/MultiBulkResponseSimpleTest.php b/tests/Predis/Iterator/MultiBulkResponseSimpleTest.php index 3701fe80..5ab5faf4 100644 --- a/tests/Predis/Iterator/MultiBulkResponseSimpleTest.php +++ b/tests/Predis/Iterator/MultiBulkResponseSimpleTest.php @@ -11,14 +11,13 @@ namespace Predis\Iterator; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; /** * @group realm-iterators */ -class MultiBulkResponseSimpleTest extends StandardTestCase +class MultiBulkResponseSimpleTest extends PredisTestCase { /** * @group connected @@ -117,23 +116,13 @@ class MultiBulkResponseSimpleTest extends StandardTestCase */ protected function getClient() { - $parameters = array( - 'host' => REDIS_SERVER_HOST, - 'port' => REDIS_SERVER_PORT, + $parameters = $this->getParametersArray(array( 'iterable_multibulk' => true, 'read_write_timeout' => 2, - ); + )); - $options = array( - 'profile' => REDIS_SERVER_VERSION, - ); - - $client = new Client($parameters, $options); - $client->connect(); - $client->select(REDIS_SERVER_DBNUM); - $client->flushdb(); + $client = $this->createClient($parameters); return $client; } - } diff --git a/tests/Predis/Iterator/MultiBulkResponseTupleTest.php b/tests/Predis/Iterator/MultiBulkResponseTupleTest.php index cb15392c..5ac5845c 100644 --- a/tests/Predis/Iterator/MultiBulkResponseTupleTest.php +++ b/tests/Predis/Iterator/MultiBulkResponseTupleTest.php @@ -11,14 +11,13 @@ namespace Predis\Iterator; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; /** * @group realm-iterators */ -class MultiBulkResponseTupleTest extends StandardTestCase +class MultiBulkResponseTupleTest extends PredisTestCase { /** * @group disconnected @@ -103,23 +102,13 @@ class MultiBulkResponseTupleTest extends StandardTestCase */ protected function getClient() { - $parameters = array( - 'host' => REDIS_SERVER_HOST, - 'port' => REDIS_SERVER_PORT, + $parameters = $this->getParametersArray(array( 'iterable_multibulk' => true, 'read_write_timeout' => 2, - ); + )); - $options = array( - 'profile' => REDIS_SERVER_VERSION, - ); - - $client = new Client($parameters, $options); - $client->connect(); - $client->select(REDIS_SERVER_DBNUM); - $client->flushdb(); + $client = $this->createClient($parameters); return $client; } - } diff --git a/tests/Predis/Monitor/MonitorContextTest.php b/tests/Predis/Monitor/MonitorContextTest.php index 24145842..7be5a6a0 100644 --- a/tests/Predis/Monitor/MonitorContextTest.php +++ b/tests/Predis/Monitor/MonitorContextTest.php @@ -11,15 +11,14 @@ namespace Predis\Monitor; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\Profile\ServerProfile; /** * @group realm-monitor */ -class MonitorContextTest extends StandardTestCase +class MonitorContextTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Option/AbstractOptionTest.php b/tests/Predis/Option/AbstractOptionTest.php index 9a6c235f..17f6acf2 100644 --- a/tests/Predis/Option/AbstractOptionTest.php +++ b/tests/Predis/Option/AbstractOptionTest.php @@ -11,12 +11,12 @@ namespace Predis\Option; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class AbstractOptionTest extends StandardTestCase +class AbstractOptionTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Option/ClientClusterTest.php b/tests/Predis/Option/ClientClusterTest.php index 2abfd139..ec8e636d 100644 --- a/tests/Predis/Option/ClientClusterTest.php +++ b/tests/Predis/Option/ClientClusterTest.php @@ -11,12 +11,12 @@ namespace Predis\Option; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ClientClusterTest extends StandardTestCase +class ClientClusterTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Option/ClientConnectionFactoryTest.php b/tests/Predis/Option/ClientConnectionFactoryTest.php index 99b256c3..c47b2c95 100644 --- a/tests/Predis/Option/ClientConnectionFactoryTest.php +++ b/tests/Predis/Option/ClientConnectionFactoryTest.php @@ -11,14 +11,13 @@ namespace Predis\Option; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Connection\ConnectionFactory; /** * */ -class ClientConnectionFactoryTest extends StandardTestCase +class ClientConnectionFactoryTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Option/ClientExceptionsTest.php b/tests/Predis/Option/ClientExceptionsTest.php index 27fe298c..ec414bd1 100644 --- a/tests/Predis/Option/ClientExceptionsTest.php +++ b/tests/Predis/Option/ClientExceptionsTest.php @@ -11,12 +11,12 @@ namespace Predis\Option; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ClientExceptionsTest extends StandardTestCase +class ClientExceptionsTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Option/ClientOptionsTest.php b/tests/Predis/Option/ClientOptionsTest.php index 12e57fc4..f74c1036 100644 --- a/tests/Predis/Option/ClientOptionsTest.php +++ b/tests/Predis/Option/ClientOptionsTest.php @@ -11,13 +11,13 @@ namespace Predis\Option; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * @todo We should test the inner work performed by this class * using mock objects, but it is quite hard to to that. */ -class ClientOptionsTest extends StandardTestCase +class ClientOptionsTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Option/ClientPrefixTest.php b/tests/Predis/Option/ClientPrefixTest.php index f007c795..08763f62 100644 --- a/tests/Predis/Option/ClientPrefixTest.php +++ b/tests/Predis/Option/ClientPrefixTest.php @@ -11,12 +11,12 @@ namespace Predis\Option; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ClientPrefixTest extends StandardTestCase +class ClientPrefixTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Option/ClientProfileTest.php b/tests/Predis/Option/ClientProfileTest.php index 483f6742..51362344 100644 --- a/tests/Predis/Option/ClientProfileTest.php +++ b/tests/Predis/Option/ClientProfileTest.php @@ -11,15 +11,14 @@ namespace Predis\Option; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Command\Processor\KeyPrefixProcessor; use Predis\Profile\ServerProfile; /** * */ -class ClientProfileTest extends StandardTestCase +class ClientProfileTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Option/ClientReplicationTest.php b/tests/Predis/Option/ClientReplicationTest.php index f8dd87ea..ba93abd3 100644 --- a/tests/Predis/Option/ClientReplicationTest.php +++ b/tests/Predis/Option/ClientReplicationTest.php @@ -11,12 +11,12 @@ namespace Predis\Option; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ClientReplicationTest extends StandardTestCase +class ClientReplicationTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Option/CustomOptionTest.php b/tests/Predis/Option/CustomOptionTest.php index 805cae2e..13f70e39 100644 --- a/tests/Predis/Option/CustomOptionTest.php +++ b/tests/Predis/Option/CustomOptionTest.php @@ -11,12 +11,12 @@ namespace Predis\Option; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class CustomOptionTest extends StandardTestCase +class CustomOptionTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Pipeline/FireAndForgetExecutorTest.php b/tests/Predis/Pipeline/FireAndForgetExecutorTest.php index e44204dc..709499a5 100644 --- a/tests/Predis/Pipeline/FireAndForgetExecutorTest.php +++ b/tests/Predis/Pipeline/FireAndForgetExecutorTest.php @@ -11,15 +11,14 @@ namespace Predis\Pipeline; -use \PHPUnit_Framework_TestCase as StandardTestCase; - use SplQueue; +use PredisTestCase; use Predis\Profile\ServerProfile; /** * */ -class FireAndForgetExecutorTest extends StandardTestCase +class FireAndForgetExecutorTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Pipeline/MultiExecExecutorTest.php b/tests/Predis/Pipeline/MultiExecExecutorTest.php index c6a3010c..02baddb3 100644 --- a/tests/Predis/Pipeline/MultiExecExecutorTest.php +++ b/tests/Predis/Pipeline/MultiExecExecutorTest.php @@ -11,10 +11,9 @@ namespace Predis\Pipeline; -use \PHPUnit_Framework_TestCase as StandardTestCase; - use ArrayIterator; use SplQueue; +use PredisTestCase; use Predis\ResponseError; use Predis\ResponseObjectInterface; use Predis\ResponseQueued; @@ -30,7 +29,7 @@ class ResponseIteratorStub extends ArrayIterator implements ResponseObjectInterf /** * */ -class MultiExecExecutorTest extends StandardTestCase +class MultiExecExecutorTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Pipeline/PipelineContextTest.php b/tests/Predis/Pipeline/PipelineContextTest.php index 8fce8390..376d2d96 100644 --- a/tests/Predis/Pipeline/PipelineContextTest.php +++ b/tests/Predis/Pipeline/PipelineContextTest.php @@ -11,8 +11,7 @@ namespace Predis\Pipeline; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\ClientException; use Predis\Profile\ServerProfile; @@ -20,7 +19,7 @@ use Predis\Profile\ServerProfile; /** * */ -class PipelineContextTest extends StandardTestCase +class PipelineContextTest extends PredisTestCase { /** * @group disconnected @@ -393,25 +392,9 @@ class PipelineContextTest extends StandardTestCase * @return array Additional client options. * @return Client New client instance. */ - protected function getClient(Array $parameters = array(), Array $options = array()) + protected function getClient(array $parameters = array(), array $options = array()) { - $parameters = array_merge(array( - 'scheme' => 'tcp', - 'host' => REDIS_SERVER_HOST, - 'port' => REDIS_SERVER_PORT, - 'database' => REDIS_SERVER_DBNUM, - ), $parameters); - - $options = array_merge(array( - 'profile' => REDIS_SERVER_VERSION, - ), $options); - - $client = new Client($parameters, $options); - - $client->connect(); - $client->flushdb(); - - return $client; + return $this->createClient($parameters, $options); } /** diff --git a/tests/Predis/Pipeline/StandardExecutorTest.php b/tests/Predis/Pipeline/StandardExecutorTest.php index e5e1c833..45ac7e5e 100644 --- a/tests/Predis/Pipeline/StandardExecutorTest.php +++ b/tests/Predis/Pipeline/StandardExecutorTest.php @@ -11,9 +11,8 @@ namespace Predis\Pipeline; -use \PHPUnit_Framework_TestCase as StandardTestCase; - use SplQueue; +use PredisTestCase; use Predis\ResponseError; use Predis\ResponseObjectInterface; use Predis\Profile\ServerProfile; @@ -21,7 +20,7 @@ use Predis\Profile\ServerProfile; /** * */ -class StandardExecutorTest extends StandardTestCase +class StandardExecutorTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/PredisExceptionTest.php b/tests/Predis/PredisExceptionTest.php index 4cfbc656..07b63816 100644 --- a/tests/Predis/PredisExceptionTest.php +++ b/tests/Predis/PredisExceptionTest.php @@ -11,12 +11,12 @@ namespace Predis; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class PredisExceptionTest extends StandardTestCase +class PredisExceptionTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Profile/ServerProfileTest.php b/tests/Predis/Profile/ServerProfileTest.php index 81dd70d5..6173973c 100644 --- a/tests/Predis/Profile/ServerProfileTest.php +++ b/tests/Predis/Profile/ServerProfileTest.php @@ -11,14 +11,13 @@ namespace Predis\Profile; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Command\Processor\ProcessorChain; /** * */ -class ServerProfileTest extends StandardTestCase +class ServerProfileTest extends PredisTestCase { const DEFAULT_PROFILE_VERSION = '2.6'; const DEVELOPMENT_PROFILE_VERSION = '3.0'; diff --git a/tests/Predis/Profile/ServerVersion12Test.php b/tests/Predis/Profile/ServerVersion12Test.php index a1747b56..1723dce3 100644 --- a/tests/Predis/Profile/ServerVersion12Test.php +++ b/tests/Predis/Profile/ServerVersion12Test.php @@ -14,12 +14,12 @@ namespace Predis\Profile; /** * */ -class ServerVersion12Test extends ServerVersionTestCase +class ServerVersion12Test extends PredisProfileTestCase { /** * {@inheritdoc} */ - public function getProfileInstance() + public function getProfile($version = null) { return new ServerVersion12(); } diff --git a/tests/Predis/Profile/ServerVersion20Test.php b/tests/Predis/Profile/ServerVersion20Test.php index 3b497369..f1f1abaa 100644 --- a/tests/Predis/Profile/ServerVersion20Test.php +++ b/tests/Predis/Profile/ServerVersion20Test.php @@ -14,12 +14,12 @@ namespace Predis\Profile; /** * */ -class ServerVersion20Test extends ServerVersionTestCase +class ServerVersion20Test extends PredisProfileTestCase { /** * {@inheritdoc} */ - public function getProfileInstance() + public function getProfile($version = null) { return new ServerVersion20(); } diff --git a/tests/Predis/Profile/ServerVersion22Test.php b/tests/Predis/Profile/ServerVersion22Test.php index 00f6e487..a62efa09 100644 --- a/tests/Predis/Profile/ServerVersion22Test.php +++ b/tests/Predis/Profile/ServerVersion22Test.php @@ -14,12 +14,12 @@ namespace Predis\Profile; /** * */ -class ServerVersion22Test extends ServerVersionTestCase +class ServerVersion22Test extends PredisProfileTestCase { /** * {@inheritdoc} */ - public function getProfileInstance() + public function getProfile($version = null) { return new ServerVersion22(); } diff --git a/tests/Predis/Profile/ServerVersion24Test.php b/tests/Predis/Profile/ServerVersion24Test.php index 5b3bbd94..899d3190 100644 --- a/tests/Predis/Profile/ServerVersion24Test.php +++ b/tests/Predis/Profile/ServerVersion24Test.php @@ -14,12 +14,12 @@ namespace Predis\Profile; /** * */ -class ServerVersion24Test extends ServerVersionTestCase +class ServerVersion24Test extends PredisProfileTestCase { /** * {@inheritdoc} */ - public function getProfileInstance() + public function getProfile($version = null) { return new ServerVersion24(); } diff --git a/tests/Predis/Profile/ServerVersion26Test.php b/tests/Predis/Profile/ServerVersion26Test.php index 94091598..bc01e5ce 100644 --- a/tests/Predis/Profile/ServerVersion26Test.php +++ b/tests/Predis/Profile/ServerVersion26Test.php @@ -14,12 +14,12 @@ namespace Predis\Profile; /** * */ -class ServerVersion26Test extends ServerVersionTestCase +class ServerVersion26Test extends PredisProfileTestCase { /** * {@inheritdoc} */ - public function getProfileInstance() + public function getProfile($version = null) { return new ServerVersion26(); } diff --git a/tests/Predis/Profile/ServerVersion28Test.php b/tests/Predis/Profile/ServerVersion28Test.php index 42a012d9..b9cf2811 100644 --- a/tests/Predis/Profile/ServerVersion28Test.php +++ b/tests/Predis/Profile/ServerVersion28Test.php @@ -14,12 +14,12 @@ namespace Predis\Profile; /** * */ -class ServerVersion28Test extends ServerVersionTestCase +class ServerVersion28Test extends PredisProfileTestCase { /** * {@inheritdoc} */ - public function getProfileInstance() + public function getProfile($version = null) { return new ServerVersion28(); } diff --git a/tests/Predis/Profile/ServerVersionNextTest.php b/tests/Predis/Profile/ServerVersionNextTest.php index 77e1e2a1..9a5a1f02 100644 --- a/tests/Predis/Profile/ServerVersionNextTest.php +++ b/tests/Predis/Profile/ServerVersionNextTest.php @@ -14,12 +14,12 @@ namespace Predis\Profile; /** * */ -class ServerVersionNextTest extends ServerVersionTestCase +class ServerVersionNextTest extends PredisProfileTestCase { /** * {@inheritdoc} */ - public function getProfileInstance() + public function getProfile($version = null) { return new ServerVersionNext(); } diff --git a/tests/Predis/Protocol/Text/ComposableTextProtocolTest.php b/tests/Predis/Protocol/Text/ComposableTextProtocolTest.php index 383ca8c6..b9bbc669 100644 --- a/tests/Predis/Protocol/Text/ComposableTextProtocolTest.php +++ b/tests/Predis/Protocol/Text/ComposableTextProtocolTest.php @@ -11,12 +11,12 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ComposableTextProtocolTest extends StandardTestCase +class ComposableTextProtocolTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Protocol/Text/ResponseBulkHandlerTest.php b/tests/Predis/Protocol/Text/ResponseBulkHandlerTest.php index 813bf370..f400c634 100644 --- a/tests/Predis/Protocol/Text/ResponseBulkHandlerTest.php +++ b/tests/Predis/Protocol/Text/ResponseBulkHandlerTest.php @@ -11,12 +11,12 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ResponseBulkHandlerTest extends StandardTestCase +class ResponseBulkHandlerTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Protocol/Text/ResponseErrorHandlerTest.php b/tests/Predis/Protocol/Text/ResponseErrorHandlerTest.php index 60ce7482..e6b0ef0e 100644 --- a/tests/Predis/Protocol/Text/ResponseErrorHandlerTest.php +++ b/tests/Predis/Protocol/Text/ResponseErrorHandlerTest.php @@ -11,12 +11,12 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ResponseErrorHandlerTest extends StandardTestCase +class ResponseErrorHandlerTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Protocol/Text/ResponseIntegerHandlerTest.php b/tests/Predis/Protocol/Text/ResponseIntegerHandlerTest.php index d7957aa7..562784fd 100644 --- a/tests/Predis/Protocol/Text/ResponseIntegerHandlerTest.php +++ b/tests/Predis/Protocol/Text/ResponseIntegerHandlerTest.php @@ -11,13 +11,13 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; use Predis\ResponseQueued; /** * */ -class ResponseIntegerHandlerTest extends StandardTestCase +class ResponseIntegerHandlerTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Protocol/Text/ResponseMultiBulkHandlerTest.php b/tests/Predis/Protocol/Text/ResponseMultiBulkHandlerTest.php index 80f52821..d1964a8b 100644 --- a/tests/Predis/Protocol/Text/ResponseMultiBulkHandlerTest.php +++ b/tests/Predis/Protocol/Text/ResponseMultiBulkHandlerTest.php @@ -11,12 +11,12 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ResponseMultiBulkHandlerTest extends StandardTestCase +class ResponseMultiBulkHandlerTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Protocol/Text/ResponseMultiBulkStreamHandlerTest.php b/tests/Predis/Protocol/Text/ResponseMultiBulkStreamHandlerTest.php index 11dba3df..cd64704e 100644 --- a/tests/Predis/Protocol/Text/ResponseMultiBulkStreamHandlerTest.php +++ b/tests/Predis/Protocol/Text/ResponseMultiBulkStreamHandlerTest.php @@ -11,12 +11,12 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ResponseMultiBulkStreamHandlerTest extends StandardTestCase +class ResponseMultiBulkStreamHandlerTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Protocol/Text/ResponseStatusHandlerTest.php b/tests/Predis/Protocol/Text/ResponseStatusHandlerTest.php index d09c8537..fabe14a5 100644 --- a/tests/Predis/Protocol/Text/ResponseStatusHandlerTest.php +++ b/tests/Predis/Protocol/Text/ResponseStatusHandlerTest.php @@ -11,13 +11,13 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; use Predis\ResponseQueued; /** * */ -class ResponseStatusHandlerTest extends StandardTestCase +class ResponseStatusHandlerTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Protocol/Text/TextCommandSerializerTest.php b/tests/Predis/Protocol/Text/TextCommandSerializerTest.php index 84482af7..5cba9ce6 100644 --- a/tests/Predis/Protocol/Text/TextCommandSerializerTest.php +++ b/tests/Predis/Protocol/Text/TextCommandSerializerTest.php @@ -11,12 +11,12 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class TextCommandSerializerTest extends StandardTestCase +class TextCommandSerializerTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Protocol/Text/TextProtocolTest.php b/tests/Predis/Protocol/Text/TextProtocolTest.php index 369a1517..07e62c5d 100644 --- a/tests/Predis/Protocol/Text/TextProtocolTest.php +++ b/tests/Predis/Protocol/Text/TextProtocolTest.php @@ -11,12 +11,12 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class TextProtocolTest extends StandardTestCase +class TextProtocolTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Protocol/Text/TextResponseReaderTest.php b/tests/Predis/Protocol/Text/TextResponseReaderTest.php index 94ddaa16..a47fd353 100644 --- a/tests/Predis/Protocol/Text/TextResponseReaderTest.php +++ b/tests/Predis/Protocol/Text/TextResponseReaderTest.php @@ -11,12 +11,12 @@ namespace Predis\Protocol\Text; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class TextResponseReaderTest extends StandardTestCase +class TextResponseReaderTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/PubSub/DispatcherLoopTest.php b/tests/Predis/PubSub/DispatcherLoopTest.php index 5df84758..1a7f8b88 100644 --- a/tests/Predis/PubSub/DispatcherLoopTest.php +++ b/tests/Predis/PubSub/DispatcherLoopTest.php @@ -11,15 +11,14 @@ namespace Predis\PubSub; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\Profile\ServerProfile; /** * @group realm-pubsub */ -class DispatcherLoopTest extends StandardTestCase +class DispatcherLoopTest extends PredisTestCase { // ******************************************************************** // // ---- INTEGRATION TESTS --------------------------------------------- // diff --git a/tests/Predis/PubSub/PubSubContextTest.php b/tests/Predis/PubSub/PubSubContextTest.php index 140e8f25..1cbe8af2 100644 --- a/tests/Predis/PubSub/PubSubContextTest.php +++ b/tests/Predis/PubSub/PubSubContextTest.php @@ -11,15 +11,14 @@ namespace Predis\PubSub; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\Profile\ServerProfile; /** * @group realm-pubsub */ -class PubSubContextTest extends StandardTestCase +class PubSubContextTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Replication/ReplicationStrategyTest.php b/tests/Predis/Replication/ReplicationStrategyTest.php index d34e29b6..e25d0860 100644 --- a/tests/Predis/Replication/ReplicationStrategyTest.php +++ b/tests/Predis/Replication/ReplicationStrategyTest.php @@ -11,15 +11,14 @@ namespace Predis\Replication; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Command\CommandInterface; use Predis\Profile\ServerProfile; /** * */ -class ReplicationStrategyTest extends StandardTestCase +class ReplicationStrategyTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/ResponseErrorTest.php b/tests/Predis/ResponseErrorTest.php index ec9e8bdc..b3a1f671 100644 --- a/tests/Predis/ResponseErrorTest.php +++ b/tests/Predis/ResponseErrorTest.php @@ -11,12 +11,12 @@ namespace Predis; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ResponseErrorTest extends StandardTestCase +class ResponseErrorTest extends PredisTestCase { const ERR_WRONG_KEY_TYPE = 'ERR Operation against a key holding the wrong kind of value'; diff --git a/tests/Predis/ResponseQueuedTest.php b/tests/Predis/ResponseQueuedTest.php index fb40011e..4b2b4c71 100644 --- a/tests/Predis/ResponseQueuedTest.php +++ b/tests/Predis/ResponseQueuedTest.php @@ -11,12 +11,12 @@ namespace Predis; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ResponseQueuedTest extends StandardTestCase +class ResponseQueuedTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/ServerExceptionTest.php b/tests/Predis/ServerExceptionTest.php index 92410448..d9aa7a15 100644 --- a/tests/Predis/ServerExceptionTest.php +++ b/tests/Predis/ServerExceptionTest.php @@ -11,12 +11,12 @@ namespace Predis; -use \PHPUnit_Framework_TestCase as StandardTestCase; +use PredisTestCase; /** * */ -class ServerExceptionTest extends StandardTestCase +class ServerExceptionTest extends PredisTestCase { const ERR_WRONG_KEY_TYPE = 'ERR Operation against a key holding the wrong kind of value'; diff --git a/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php b/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php index ad4f06ee..fc10e92c 100644 --- a/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php +++ b/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php @@ -11,14 +11,13 @@ namespace Predis\Transaction; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; /** * */ -class AbortedMultiExecExceptionTest extends StandardTestCase +class AbortedMultiExecExceptionTest extends PredisTestCase { /** * @group disconnected diff --git a/tests/Predis/Transaction/MultiExecContextTest.php b/tests/Predis/Transaction/MultiExecContextTest.php index c22286f1..b0f93dff 100644 --- a/tests/Predis/Transaction/MultiExecContextTest.php +++ b/tests/Predis/Transaction/MultiExecContextTest.php @@ -11,8 +11,7 @@ namespace Predis\Transaction; -use \PHPUnit_Framework_TestCase as StandardTestCase; - +use PredisTestCase; use Predis\Client; use Predis\ResponseQueued; use Predis\ServerException; @@ -21,7 +20,7 @@ use Predis\Command\CommandInterface; /** * @group realm-transaction */ -class MultiExecContextTest extends StandardTestCase +class MultiExecContextTest extends PredisTestCase { /** * @group disconnected @@ -761,24 +760,8 @@ class MultiExecContextTest extends StandardTestCase * @param array Additional client options. * @return Client client instance. */ - protected function getClient(Array $parameters = array(), Array $options = array()) + protected function getClient(array $parameters = array(), array $options = array()) { - $parameters = array_merge(array( - 'scheme' => 'tcp', - 'host' => REDIS_SERVER_HOST, - 'port' => REDIS_SERVER_PORT, - 'database' => REDIS_SERVER_DBNUM, - ), $parameters); - - $options = array_merge(array( - 'profile' => REDIS_SERVER_VERSION - ), $options); - - $client = new Client($parameters, $options); - - $client->connect(); - $client->flushdb(); - - return $client; + return $this->createClient($parameters, $options); } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 505488a7..af92a0d4 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -13,7 +13,8 @@ require __DIR__.'/../autoload.php'; require __DIR__.'/PHPUnit/ArrayHasSameValuesConstraint.php'; require __DIR__.'/PHPUnit/RedisCommandConstraint.php'; -require __DIR__.'/PHPUnit/CommandTestCase.php'; -require __DIR__.'/PHPUnit/ConnectionTestCase.php'; -require __DIR__.'/PHPUnit/ServerVersionTestCase.php'; -require __DIR__.'/PHPUnit/DistributionStrategyTestCase.php'; +require __DIR__.'/PHPUnit/PredisTestCase.php'; +require __DIR__.'/PHPUnit/PredisCommandTestCase.php'; +require __DIR__.'/PHPUnit/PredisConnectionTestCase.php'; +require __DIR__.'/PHPUnit/PredisProfileTestCase.php'; +require __DIR__.'/PHPUnit/PredisDistributorTestCase.php';