public function testVerifyPeersWhenSourceAndTargetAlreadyExist() { $this->source->expects($this->once())->method('getDatabase')->willReturn('test_source_database'); $this->source->expects($this->once())->method('getDatabaseInfo')->willReturn(array('db_name' => 'test_source_database', 'instance_start_time' => '123', 'update_seq' => '456')); $this->target->expects($this->once())->method('getDatabase')->willReturn('test_target_database'); $this->target->expects($this->once())->method('getDatabaseInfo')->willReturn(array('db_name' => 'test_target_database', 'instance_start_time' => '123', 'update_seq' => '456')); $task = new ReplicationTask(); $replication = new Replication($this->source, $this->target, $task); list($sourceInfo, $targetInfo) = $replication->verifyPeers(); $this->assertArrayHasKey("update_seq", $sourceInfo, 'Source info not correctly returned.'); $this->assertArrayHasKey("instance_start_time", $sourceInfo, 'Source info not correctly returned.'); $this->assertArrayHasKey("update_seq", $targetInfo, 'Target info not correctly returned.'); $this->assertArrayHasKey("instance_start_time", $targetInfo, 'Target info not correctly returned.'); }