getSlaveClients() public method

If an array of Credis_Client objects exist for a set of slaves, return them. Otherwise create and return them
public getSlaveClients ( string $name ) : Credis_Client[]
$name string
return Credis_Client[]
Exemplo n.º 1
0
 public function testSlaveClient()
 {
     $slaves = $this->sentinel->getSlaveClients($this->sentinelConfig->clustername);
     $this->assertInternalType('array', $slaves);
     $this->assertCount(1, $slaves);
     foreach ($slaves as $slave) {
         $this->assertInstanceOf('Credis_Client', $slave);
     }
     $this->setExpectedException('CredisException', 'No such master with that name');
     $this->sentinel->getSlaveClients('non-existing-cluster');
 }