6 declare(strict_types=1);
11 use Symfony\Component\Console\Tester\CommandTester;
18 private $installerFactory;
23 private $deploymentConfig;
27 $this->installerFactory = $this->createMock(\
Magento\Setup\Model\InstallerFactory::class);
28 $this->deploymentConfig = $this->createMock(\
Magento\Framework\
App\DeploymentConfig::class);
38 $this->deploymentConfig->expects($this->once())->method(
'isAvailable')->will($this->returnValue(
true));
40 $this->installerFactory->expects($this->once())->method(
'create')->will($this->returnValue(
$installer));
42 ->expects($this->once())
43 ->method(
'installSchema')
44 ->with($expectedOptions);
46 $commandTester =
new CommandTester(
60 '--magento-init-params' =>
'',
61 '--convert-old-scripts' =>
false 63 'expectedOptions' => [
64 'convert-old-scripts' =>
false,
65 'magento-init-params' =>
'',
73 $this->deploymentConfig->expects($this->once())->method(
'isAvailable')->will($this->returnValue(
false));
74 $this->installerFactory->expects($this->never())->method(
'create');
76 $commandTester =
new CommandTester(
79 $commandTester->execute([]);
80 $this->assertStringMatchesFormat(
81 'No information is available: the Magento application is not installed.%w',
82 $commandTester->getDisplay()
testExecute($options, $expectedOptions)