Add support for the 'redis://' scheme in URI strings.

The URI string will be handled following the rules as described by the
the provisional IANA registration document that can be found on IANA's
website: http://www.iana.org/assignments/uri-schemes/prov/redis.
This commit is contained in:
Daniele Alessandri
2015-07-23 17:27:58 +02:00
parent 474f3ddbe7
commit 35f135be30
14 changed files with 308 additions and 38 deletions
@@ -29,12 +29,34 @@ class CompositeStreamConnectionTest extends PredisConnectionTestCase
/**
* @group disconnected
*/
public function testExposesParameters()
public function testSupportsSchemeTCP()
{
$parameters = $this->getParameters();
$connection = new CompositeStreamConnection($parameters);
$parameters = $this->getParameters(array('scheme' => 'tcp'));
$connection = new StreamConnection($parameters);
$this->assertSame($parameters, $connection->getParameters());
$this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
}
/**
* @group disconnected
*/
public function testSupportsSchemeRedis()
{
$parameters = $this->getParameters(array('scheme' => 'redis'));
$connection = new StreamConnection($parameters);
$this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
}
/**
* @group disconnected
*/
public function testSupportsSchemeUnix()
{
$parameters = $this->getParameters(array('scheme' => 'unix'));
$connection = new StreamConnection($parameters);
$this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
}
/**
@@ -48,6 +70,17 @@ class CompositeStreamConnectionTest extends PredisConnectionTestCase
new CompositeStreamConnection($parameters);
}
/**
* @group disconnected
*/
public function testExposesParameters()
{
$parameters = $this->getParameters();
$connection = new CompositeStreamConnection($parameters);
$this->assertSame($parameters, $connection->getParameters());
}
/**
* @group disconnected
*/