/** * @depends testBackupConfig */ public function testRestoreFromBackup() { $testFolderPath = __DIR__ . '/test-folder'; $configHandler = new ConfigFileHandler('test-process', $testFolderPath); chmod($testFolderPath, 0777); file_put_contents($testFolderPath . '/test.conf', "The new contents of the file"); $configHandler->backupConfig('test.zip'); $this->assertFileExists($testFolderPath . '/test.zip'); $configHandler->restoreFromBackup('test.zip'); $this->assertFileExists($testFolderPath . '/test.conf'); unlink($testFolderPath . '/test.conf'); unlink($testFolderPath . '/test.zip'); rmdir($testFolderPath); }