/** * @group disconnected */ public function testSwitchesToMasterWithReplicationConnection() { $connection = $this->getMock('Predis\\Connection\\Aggregate\\ReplicationInterface'); $connection->expects($this->once())->method('switchTo')->with('master'); $connection->expects($this->exactly(3))->method('writeRequest'); $connection->expects($this->never())->method('readResponse'); $pipeline = new FireAndForget(new Client($connection)); $pipeline->ping(); $pipeline->ping(); $pipeline->ping(); $this->assertEmpty($pipeline->execute()); }