10 require_once
__DIR__ .
'/_files/ioMock.php';
12 class FsTest extends \PHPUnit\Framework\TestCase
17 private $objectManager;
22 private $snapshotMock;
27 private $fsHelperMock;
51 $this->backupPath =
'/some/test/path';
53 $this->ignorePaths = [];
56 $this->snapshotMock = $this->getMockBuilder(\
Magento\Framework\Backup\Filesystem::class)
57 ->setMethods([
'getBackupPath',
'getRootDir',
'getIgnorePaths'])
59 $this->snapshotMock->expects($this->any())
60 ->method(
'getBackupPath')
61 ->willReturn($this->backupPath);
62 $this->snapshotMock->expects($this->any())
63 ->method(
'getRootDir')
64 ->willReturn($this->rootDir);
65 $this->snapshotMock->expects($this->any())
66 ->method(
'getIgnorePaths')
67 ->willReturn($this->ignorePaths);
68 $this->fsHelperMock = $this->getMockBuilder(\
Magento\Framework\Backup\
Filesystem\Helper::class)
69 ->setMethods([
'getInfo',
'rm'])
71 $this->fs = $this->objectManager->getObject(
74 'snapshotObject' => $this->snapshotMock,
75 'fsHelper' => $this->fsHelperMock,
88 'writableMeta' => [
'test1',
'test2'],
91 $this->fsHelperMock->expects($this->once())
93 ->willReturn($fsInfo);
99 $fsInfo = [
'writable' =>
true];
101 $this->fsHelperMock->expects($this->once())
103 ->willReturn($fsInfo);
104 $this->fsHelperMock->expects($this->once())
106 ->with($this->rootDir, $this->ignorePaths);
defined('TESTS_BP')||define('TESTS_BP' __DIR__
testRunNotEnoughPermissions()