/** * @group disconnected */ public function testReadsCommandFromCorrectConnection() { $profile = ServerProfile::getDefault(); $cmdExists = $profile->createCommand('exists', array('foo')); $cmdSet = $profile->getDefault()->createCommand('set', array('foo', 'bar')); $master = $this->getMockConnection('tcp://host1?alias=master'); $master->expects($this->once())->method('readResponse')->with($cmdSet); $slave1 = $this->getMockConnection('tcp://host2?alias=slave1'); $slave1->expects($this->once())->method('readResponse')->with($cmdExists); $replication = new MasterSlaveReplication(); $replication->add($master); $replication->add($slave1); $replication->readResponse($cmdExists); $replication->readResponse($cmdSet); }