[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.
This commit is contained in:
Daniele Alessandri
2013-11-30 18:05:56 +01:00
parent 7f690cb62e
commit b253bdc41e
218 changed files with 411 additions and 754 deletions
+2 -42
View File
@@ -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;
@@ -22,7 +21,7 @@ use Predis\Response;
/**
*
*/
class ClientTest extends StandardTestCase
class ClientTest extends PredisTestCase
{
/**
* @group disconnected
@@ -756,45 +755,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.
*