mirror of
https://github.com/predis/predis.git
synced 2026-10-13 23:37:48 +00:00
[tests] Share common test among connection classes.
This commit is contained in:
@@ -16,6 +16,8 @@ namespace Predis\Connection;
|
||||
*/
|
||||
class StreamConnectionTest extends PredisConnectionTestCase
|
||||
{
|
||||
const CONNECTION_CLASS = 'Predis\Connection\StreamConnection';
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
@@ -212,31 +214,4 @@ class StreamConnectionTest extends PredisConnectionTestCase
|
||||
|
||||
$connection->read();
|
||||
}
|
||||
|
||||
// ******************************************************************** //
|
||||
// ---- HELPER METHODS ------------------------------------------------ //
|
||||
// ******************************************************************** //
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getConnection(&$profile = null, $initialize = false, array $parameters = array())
|
||||
{
|
||||
$parameters = $this->getParameters($parameters);
|
||||
$profile = $this->getProfile();
|
||||
|
||||
$connection = new StreamConnection($parameters);
|
||||
|
||||
if ($initialize) {
|
||||
$connection->addConnectCommand(
|
||||
$profile->createCommand('select', array($parameters->database))
|
||||
);
|
||||
|
||||
$connection->addConnectCommand(
|
||||
$profile->createCommand('flushdb')
|
||||
);
|
||||
}
|
||||
|
||||
return $connection;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user