protected function execute(InputInterface $input, OutputInterface $output) { $config = $this->getHelper('configuration')->fetch(); $replication = Replication::createFromConfig($config); $replication->stats(); }
/** * @param array $data * @expectedException \Phlib\Db\Exception\RuntimeException * @dataProvider fetchStatusErrorsWithBadReturnedDataDataProvider */ public function testFetchStatusErrorsWithBadReturnedData($data) { $pdoStatement = $this->getMock(\PDOStatement::class); $pdoStatement->expects($this->any())->method('fetch')->will($this->returnValue($data)); $slave = $this->getMock(AdapterInterface::class); $slave->expects($this->any())->method('query')->will($this->returnValue($pdoStatement)); $replication = new Replication($this->master, [$slave], $this->storage); $replication->fetchStatus($slave); }
protected function getReplication() { $config = $this->getHelper('configuration')->fetch(); return Replication::createFromConfig($config); }