コード例 #1
0
 protected function setUp()
 {
     $this->_magento = Helper::createTempDir();
     $this->_target = Helper::createTempDir();
     $this->_temp = Helper::createTempDir();
     Helper::emulateMagentoFileStructure($this->_magento);
     $this->_installMagento();
 }
コード例 #2
0
 public function testShouldCleanupTargetIfErrorOccuredDuringInstallation()
 {
     // prepare
     Helper::emulateMagentoFileStructure($this->_magento);
     $installer = new MagentoWithMockedRun($this->_target, $this->_magento, self::DB_HOSTNAME, self::DB_USERNAME, self::DB_PASSWORD, self::DB_NAME, 'url');
     $installer->setThrowExceptionFromInstall(true);
     // act
     try {
         $installer->install();
     } catch (MyException $e) {
     }
     // assert
     $this->assertFalse($installer->isInstalled());
     foreach (new \DirectoryIterator($this->_target) as $item) {
         if (!$item->isDot()) {
             $this->fail('Target is not empty.');
         }
     }
 }