[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
@@ -11,8 +11,7 @@
namespace Predis\Connection;
use PHPUnit_Framework_TestCase as StandardTestCase;
use PredisTestCase;
use Predis\Profile;
/**
@@ -21,7 +20,7 @@ use Predis\Profile;
* @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 Profile\ProfileInterface
*/
protected function getProfile($version = null)
{
return Profile\Factory::get($version ?: REDIS_SERVER_VERSION);
}
/**
* Returns a new instance of a connection instance.
*