Predis\Connection\Aggregate\PredisCluster::connect PHP Method

connect() public method

public connect ( )
    public function connect()
    {
        foreach ($this->pool as $connection) {
            $connection->connect();
        }
    }

Usage Example

 /**
  * @group disconnected
  */
 public function testConnectForcesAllConnectionsToConnect()
 {
     $connection1 = $this->getMockConnection();
     $connection1->expects($this->once())->method('connect');
     $connection2 = $this->getMockConnection();
     $connection2->expects($this->once())->method('connect');
     $cluster = new PredisCluster();
     $cluster->add($connection1);
     $cluster->add($connection2);
     $cluster->connect();
 }