slaves() public method

Return all information for slaves that are associated with a single master
public slaves ( string $name ) : mixed
$name string
return mixed
Exemplo n.º 1
0
 public function testSlaves()
 {
     $slaves = $this->sentinel->slaves($this->sentinelConfig->clustername);
     $this->assertInternalType('array', $slaves);
     $this->assertCount(1, $slaves);
     $this->assertArrayHasKey(0, $slaves);
     $this->assertArrayHasKey(5, $slaves[0]);
     $this->assertEquals(6385, $slaves[0][5]);
     $slaves = $this->sentinel->slaves('masterdown');
     $this->assertInternalType('array', $slaves);
     $this->assertCount(0, $slaves);
     $this->setExpectedException('CredisException', 'No such master with that name');
     $this->sentinel->slaves('non-existing-cluster');
 }