|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / a / home / dev2.destoffenstraat.com / vendor / colinmollenhour / credis / tests / |
Filename | /home/a/home/dev2.destoffenstraat.com/vendor/colinmollenhour/credis/tests/CredisStandaloneTest.php |
Size | 1.69 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 26-Nov-2019 19:09 |
Last accessed | 23-Aug-2025 18:58 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
require_once dirname(__FILE__).'/CredisTest.php';
class CredisStandaloneTest extends CredisTest
{
protected $useStandalone = TRUE;
/**
* @group UnixSocket
*/
public function testInvalidPersistentConnectionOnUnixSocket()
{
$this->credis->close();
$this->credis = new Credis_Client('unix://'.realpath(__DIR__).'/redis.sock',0,null,'persistent');
$this->credis->forceStandalone();
//$this->setExpectedException('CredisException','Persistent connections to UNIX sockets are not supported in standalone mode.');
$this->credis->connect();
$this->assertTrue($this->credis->isConnected());
}
public function testPersistentConnectionsOnStandAloneTcpConnection()
{
$this->credis->close();
$this->credis = new Credis_Client('tcp://'.$this->redisConfig[0]['host'] . ':' . $this->redisConfig[0]['port'] . '/persistent');
$this->credis->forceStandalone();
$this->credis->set('key','value');
$this->assertEquals('value',$this->credis->get('key'));
}
public function testPersistentvsNonPersistent() {$this->assertTrue(true);}
public function testStandAloneArgumentsExtra()
{
$this->assertTrue($this->credis->hMSet('hash', array('field1' => 'value1', 'field2' => 'value2'), 'field3', 'value3'));
$this->assertEquals(array('field1' => 'value1', 'field2' => 'value2', 'field3' =>'value3'), $this->credis->hMGet('hash', array('field1','field2','field3')));
}
public function testStandAloneMultiPipelineThrowsException()
{
$this->setExpectedExceptionShim('CredisException','A pipeline is already in use and only one pipeline is supported.');
$this->credis->pipeline()->pipeline();
}
}
require_once dirname(__FILE__).'/CredisTest.php';
class CredisStandaloneTest extends CredisTest
{
protected $useStandalone = TRUE;
/**
* @group UnixSocket
*/
public function testInvalidPersistentConnectionOnUnixSocket()
{
$this->credis->close();
$this->credis = new Credis_Client('unix://'.realpath(__DIR__).'/redis.sock',0,null,'persistent');
$this->credis->forceStandalone();
//$this->setExpectedException('CredisException','Persistent connections to UNIX sockets are not supported in standalone mode.');
$this->credis->connect();
$this->assertTrue($this->credis->isConnected());
}
public function testPersistentConnectionsOnStandAloneTcpConnection()
{
$this->credis->close();
$this->credis = new Credis_Client('tcp://'.$this->redisConfig[0]['host'] . ':' . $this->redisConfig[0]['port'] . '/persistent');
$this->credis->forceStandalone();
$this->credis->set('key','value');
$this->assertEquals('value',$this->credis->get('key'));
}
public function testPersistentvsNonPersistent() {$this->assertTrue(true);}
public function testStandAloneArgumentsExtra()
{
$this->assertTrue($this->credis->hMSet('hash', array('field1' => 'value1', 'field2' => 'value2'), 'field3', 'value3'));
$this->assertEquals(array('field1' => 'value1', 'field2' => 'value2', 'field3' =>'value3'), $this->credis->hMGet('hash', array('field1','field2','field3')));
}
public function testStandAloneMultiPipelineThrowsException()
{
$this->setExpectedExceptionShim('CredisException','A pipeline is already in use and only one pipeline is supported.');
$this->credis->pipeline()->pipeline();
}
}