/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Framework/Backup/FilesystemTest.php
50 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Copyright 2016 Adobe * All Rights Reserved. */ namespace Magento\Framework\Backup; use \Magento\TestFramework\Helper\Bootstrap; use \Magento\Framework\App\Filesystem\DirectoryList; class FilesystemTest extends \PHPUnit\Framework\TestCase { /** * @var \Magento\Framework\ObjectManagerInterface */ private $objectManager; /** * @var \Magento\Framework\Backup\Filesystem */ private $filesystem; protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); $this->filesystem = $this->objectManager->create(\Magento\Framework\Backup\Filesystem::class); } /** * @magentoAppIsolation enabled */ public function testRollback() { $rootDir = Bootstrap::getInstance()->getAppTempDir() . '/rollback_test_' . time(); $backupsDir = __DIR__ . '/_files/var/backups'; $fileName = 'test.txt'; mkdir($rootDir); $this->filesystem->setRootDir($rootDir) ->setBackupsDir($backupsDir) ->setTime(1474538269) ->setName('code') ->setBackupExtension('tgz'); $this->assertTrue($this->filesystem->rollback()); $this->assertFileExists($rootDir . '/' . $fileName); } }