getMasterClient() public method

If a Credis_Client object exists for a master, return it. Otherwise create one and return it
public getMasterClient ( string $name ) : Credis_Client
$name string
return Credis_Client
Esempio n. 1
0
 public function testMasterClient()
 {
     $master = $this->sentinel->getMasterClient($this->sentinelConfig->clustername);
     $this->assertInstanceOf('Credis_Client', $master);
     $this->assertEquals($this->redisConfig[0]['port'], $master->getPort());
     $this->setExpectedException('CredisException', 'Master not found');
     $this->sentinel->getMasterClient('non-existing-cluster');
 }