File tree Expand file tree Collapse file tree 3 files changed +44
-2
lines changed
dev/tests/integration/testsuite/Magento/Framework/Backup
lib/internal/Magento/Framework/Backup Expand file tree Collapse file tree 3 files changed +44
-2
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Framework \Backup ;
7
+
8
+ class FilesystemTest extends \PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @var \Magento\Framework\ObjectManagerInterface
12
+ */
13
+ private $ objectManager ;
14
+
15
+ /**
16
+ * @var \Magento\Framework\Backup\Filesystem
17
+ */
18
+ private $ filesystem ;
19
+
20
+ protected function setUp ()
21
+ {
22
+ $ this ->objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
23
+ $ this ->filesystem = $ this ->objectManager ->create (\Magento \Framework \Backup \Filesystem::class);
24
+ }
25
+
26
+ public function testRollback ()
27
+ {
28
+ $ rootDir = __DIR__ . '/_files ' ;
29
+ $ backupsDir = $ rootDir . '/var/backups ' ;
30
+ $ fileName = 'test.txt ' ;
31
+
32
+ $ this ->filesystem ->setRootDir ($ rootDir )
33
+ ->setBackupsDir ($ backupsDir )
34
+ ->setTime (1474538269 )
35
+ ->setName ('code ' )
36
+ ->setBackupExtension ('tgz ' );
37
+
38
+ $ this ->assertTrue ($ this ->filesystem ->rollback ());
39
+ $ this ->assertTrue (file_exists ($ rootDir . '/ ' . $ fileName ));
40
+ $ this ->assertTrue (unlink ($ rootDir . '/ ' . $ fileName ));
41
+ }
42
+ }
Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ protected function getRollBackFtp()
316
316
if (!$ this ->rollBackFtp ) {
317
317
$ this ->rollBackFtp = ObjectManager::getInstance ()->create (
318
318
\Magento \Framework \Backup \Filesystem \Rollback \Ftp::class,
319
- [$ this ]
319
+ [' snapshotObject ' => $ this ]
320
320
);
321
321
}
322
322
@@ -332,7 +332,7 @@ protected function getRollBackFs()
332
332
if (!$ this ->rollBackFs ) {
333
333
$ this ->rollBackFs = ObjectManager::getInstance ()->create (
334
334
\Magento \Framework \Backup \Filesystem \Rollback \Fs::class,
335
- [$ this ]
335
+ [' snapshotObject ' => $ this ]
336
336
);
337
337
}
338
338
You can’t perform that action at this time.
0 commit comments