Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BackupRollbackFactoryTest.php
Go to the documentation of this file.
1 <?php
7 
9 
10 class BackupRollbackFactoryTest extends \PHPUnit\Framework\TestCase
11 {
12  public function testCreate()
13  {
14  $objectManager = $this->getMockForAbstractClass(
15  \Magento\Framework\ObjectManagerInterface::class,
16  [],
17  '',
18  false
19  );
20  $consoleLogger = $this->createMock(\Magento\Framework\Setup\ConsoleLogger::class);
21  $factory = $this->createMock(\Magento\Framework\Setup\BackupRollback::class);
22  $output = $this->getMockForAbstractClass(
23  \Symfony\Component\Console\Output\OutputInterface::class,
24  [],
25  '',
26  false
27  );
28  $objectManager->expects($this->exactly(2))
29  ->method('create')
30  ->will($this->returnValueMap([
31  [\Magento\Framework\Setup\ConsoleLogger::class, ['output' => $output], $consoleLogger],
32  [\Magento\Framework\Setup\BackupRollback::class, ['log' => $consoleLogger], $factory],
33  ]));
35  $this->assertInstanceOf(\Magento\Framework\Setup\BackupRollback::class, $model->create($output));
36  }
37 }
$objectManager
Definition: bootstrap.php:17