public function testHistoryGetsNewSlaveValue() { $maxEntries = Replication::MAX_HISTORY; $newValue = 5; $history = array_pad([], $maxEntries / 2, 20); $slave = $this->getMock(AdapterInterface::class); $this->setupSlave($slave, ['Seconds_Behind_Master' => $newValue]); $this->storage->expects($this->any())->method('getHistory')->will($this->returnValue($history)); $this->storage->expects($this->once())->method('setHistory')->with($this->anything(), $this->contains($newValue)); $replication = new Replication($this->master, [$slave], $this->storage); $replication->monitor(); }
protected function execute(InputInterface $input, OutputInterface $output) { $this->replication->monitor(); }