public function testUninstall()
 {
     $this->config->expects($this->once())->method('isAvailable')->willReturn(false);
     $varDir = $this->getMockForAbstractClass('Magento\\Framework\\Filesystem\\Directory\\WriteInterface');
     $varDir->expects($this->once())->method('getAbsolutePath')->willReturn('/var');
     $staticDir = $this->getMockForAbstractClass('Magento\\Framework\\Filesystem\\Directory\\WriteInterface');
     $staticDir->expects($this->once())->method('getAbsolutePath')->willReturn('/static');
     $configDir = $this->getMockForAbstractClass('Magento\\Framework\\Filesystem\\Directory\\WriteInterface');
     $configDir->expects($this->once())->method('getAbsolutePath')->willReturn('/config/config.php');
     $this->filesystem->expects($this->any())->method('getDirectoryWrite')->will($this->returnValueMap([[DirectoryList::VAR_DIR, DriverPool::FILE, $varDir], [DirectoryList::STATIC_VIEW, DriverPool::FILE, $staticDir], [DirectoryList::CONFIG, DriverPool::FILE, $configDir]]));
     $this->logger->expects($this->at(0))->method('log')->with('Starting Magento uninstallation:');
     $this->logger->expects($this->at(1))->method('log')->with('No database connection defined - skipping database cleanup');
     $this->logger->expects($this->at(2))->method('log')->with('File system cleanup:');
     $this->logger->expects($this->at(3))->method('log')->with("The directory '/var' doesn't exist - skipping cleanup");
     $this->logger->expects($this->at(4))->method('log')->with("The directory '/static' doesn't exist - skipping cleanup");
     $this->logger->expects($this->at(5))->method('log')->with("The file '/config/config.php' doesn't exist - skipping cleanup");
     $this->logger->expects($this->once())->method('logSuccess')->with('Magento uninstallation complete.');
     $this->object->uninstall();
 }
Beispiel #2
0
 public function testUninstall()
 {
     $this->config->expects($this->once())->method('isAvailable')->willReturn(false);
     $configDir = $this->getMockForAbstractClass('Magento\\Framework\\Filesystem\\Directory\\WriteInterface');
     $configDir->expects($this->once())->method('getAbsolutePath')->willReturn('/config/config.php');
     $this->filesystem->expects($this->any())->method('getDirectoryWrite')->will($this->returnValueMap([[DirectoryList::CONFIG, DriverPool::FILE, $configDir]]));
     $this->logger->expects($this->at(0))->method('log')->with('Starting Magento uninstallation:');
     $this->logger->expects($this->at(1))->method('log')->with('No database connection defined - skipping database cleanup');
     $cache = $this->getMock('Magento\\Framework\\App\\Cache', [], [], '', false);
     $cache->expects($this->once())->method('clean');
     $this->objectManager->expects($this->once())->method('create')->will($this->returnValueMap([['Magento\\Framework\\App\\Cache', [], $cache]]));
     $this->logger->expects($this->at(2))->method('log')->with('Cache cleared successfully');
     $this->logger->expects($this->at(3))->method('log')->with('File system cleanup:');
     $this->logger->expects($this->at(4))->method('log')->with("The directory '/var' doesn't exist - skipping cleanup");
     $this->logger->expects($this->at(5))->method('log')->with("The directory '/static' doesn't exist - skipping cleanup");
     $this->logger->expects($this->at(6))->method('log')->with("The file '/config/config.php' doesn't exist - skipping cleanup");
     $this->logger->expects($this->once())->method('logSuccess')->with('Magento uninstallation complete.');
     $this->cleanupFiles->expects($this->once())->method('clearAllFiles')->will($this->returnValue(["The directory '/var' doesn't exist - skipping cleanup", "The directory '/static' doesn't exist - skipping cleanup"]));
     $this->object->uninstall();
 }
 /**
  * Controller for Uninstall Command
  *
  * @return void
  */
 public function uninstallAction()
 {
     $this->installer->uninstall();
 }