Exemple #1
0
 public function getDefault()
 {
     return \Predis\RedisServerProfile::getDefault();
 }
Exemple #2
0
 function testConnection_ReadTimeout()
 {
     $timeout = 1;
     $args = array_merge(RC::getConnectionArguments(), array('read_write_timeout' => $timeout));
     $cmdFake = \Predis\RedisServerProfile::getDefault()->createCommand('ping');
     $connection = new \Predis\TcpConnection(new \Predis\ConnectionParameters($args));
     $expectedMessage = 'Error while reading line from the server';
     $start = time();
     RC::testForCommunicationException($this, $expectedMessage, function () use($connection, $cmdFake) {
         $connection->readResponse($cmdFake);
     });
     $this->assertEquals((double) (time() - $start), $timeout, '', 1);
 }