SnapshotTest.php 996 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Backup\Test\Unit;
  7. class SnapshotTest extends \PHPUnit\Framework\TestCase
  8. {
  9. public function testGetDbBackupFilename()
  10. {
  11. $filesystem = $this->createMock(\Magento\Framework\Filesystem::class);
  12. $backupFactory = $this->createMock(\Magento\Framework\Backup\Factory::class);
  13. $manager = $this->getMockBuilder(\Magento\Framework\Backup\Snapshot::class)
  14. ->setMethods(['getBackupFilename'])
  15. ->setConstructorArgs([$filesystem, $backupFactory])
  16. ->getMock();
  17. $file = 'var/backup/2.sql';
  18. $manager->expects($this->once())->method('getBackupFilename')->will($this->returnValue($file));
  19. $model = new \Magento\Framework\Backup\Snapshot($filesystem, $backupFactory);
  20. $model->setDbBackupManager($manager);
  21. $this->assertEquals($file, $model->getDbBackupFilename());
  22. }
  23. }