Esempio n. 1
0
 public function testCleanupDb()
 {
     $this->config->expects($this->once())->method('isAvailable')->willReturn(true);
     $this->config->expects($this->once())->method('getSegment')->with(DbConfig::CONFIG_KEY)->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('Recreating database `magento`');
     $this->object->cleanupDb();
 }