private function setupDbBackupRollback()
 {
     $this->database->expects($this->once())->method('setBackupsDir');
     $this->database->expects($this->once())->method('setBackupExtension');
     $this->database->expects($this->once())->method('setTime');
     $this->database->expects($this->once())->method('getBackupFilename')->willReturn('RollbackFile_A.gz');
     $this->database->expects($this->atLeastOnce())->method('getBackupPath')->willReturn('pathToFile/12345_db.tgz');
     $this->log->expects($this->once())->method('logSuccess');
 }
예제 #2
0
 public function testCleanupDb()
 {
     $this->config->expects($this->once())->method('get')->with(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT)->willReturn(self::$dbConfig);
     $this->connection->expects($this->at(0))->method('quoteIdentifier')->with('magento')->willReturn('`magento`');
     $this->connection->expects($this->at(1))->method('query')->with('DROP DATABASE IF EXISTS `magento`');
     $this->connection->expects($this->at(2))->method('query')->with('CREATE DATABASE IF NOT EXISTS `magento`');
     $this->logger->expects($this->once())->method('log')->with('Cleaning up database `magento`');
     $this->object->cleanupDb();
 }