Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $config = $this->getHelper('configuration')->fetch();
     $replication = Replication::createFromConfig($config);
     $replication->stats();
 }
Example #2
0
 /**
  * @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);
 }
Example #3
0
 protected function getReplication()
 {
     $config = $this->getHelper('configuration')->fetch();
     return Replication::createFromConfig($config);
 }