Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
SystemBackupTest.php
Go to the documentation of this file.
1 <?php
7 declare(strict_types=1);
8 
10 
12 use PHPUnit\Framework\TestCase;
13 use Magento\Backup\Helper\Data as Helper;
15 
16 class SystemBackupTest extends TestCase
17 {
21  private $helperMock;
22 
26  private $cron;
27 
31  protected function setUp()
32  {
33  $objectManager = new ObjectManager($this);
34  $this->helperMock = $this->getMockBuilder(Helper::class)->disableOriginalConstructor()->getMock();
35  $this->cron = $objectManager->getObject(SystemBackup::class, ['backupData' => $this->helperMock]);
36  }
37 
41  public function testDisabled()
42  {
43  $this->helperMock->expects($this->any())->method('isEnabled')->willReturn(false);
44  $this->cron->execute();
45  }
46 }
$objectManager
Definition: bootstrap.php:17