38 'id' =>
'1385661590_snapshot',
40 'path' =>
'C:\test\test\var\backups',
44 $this->_fsCollection = $this->createMock(\
Magento\Backup\Model\Fs\Collection::class);
45 $this->_fsCollection->expects(
50 $this->returnValue(
new \ArrayIterator([
new \
Magento\Framework\DataObject($this->_data)]))
53 $this->_backupModel = $this->createMock(\
Magento\Backup\Model\Backup::class);
55 $this->_objectManager = $this->createMock(\
Magento\Framework\ObjectManagerInterface::class);
56 $this->_objectManager->expects(
61 \
Magento\Backup\Model\Fs\Collection::class
63 $this->returnValue($this->_fsCollection)
65 $this->_objectManager->expects(
70 \
Magento\Backup\Model\Backup::class
72 $this->returnValue($this->_backupModel)
75 $this->_instance = new \Magento\Backup\Model\BackupFactory($this->_objectManager);
80 $this->_backupModel->expects($this->once())
82 ->with($this->_data[
'type'])
83 ->will($this->returnSelf());
85 $this->_backupModel->expects($this->once())
87 ->with($this->_data[
'time'])
88 ->will($this->returnSelf());
90 $this->_backupModel->expects($this->once())
92 ->with($this->_data[
'name'])
93 ->will($this->returnSelf());
95 $this->_backupModel->expects($this->once())
97 ->with($this->_data[
'path'])
98 ->will($this->returnSelf());
100 $this->_backupModel->expects($this->once())
102 ->will($this->returnSelf());
104 $this->_instance->create(
'1385661590',
'snapshot');
109 $this->_backupModel->expects($this->never())->method(
'setType');
110 $this->_backupModel->expects($this->never())->method(
'setTime');
111 $this->_backupModel->expects($this->never())->method(
'setName');
112 $this->_backupModel->expects($this->never())->method(
'setPath');
114 $this->_instance->create(
'451094400',
'snapshot');