9 use Symfony\Component\Console\Input\ArrayInput;
10 use Symfony\Component\Console\Input\InputDefinition;
11 use Symfony\Component\Console\Input\InputArgument;
27 $arrayInput =
new ArrayInput($arrayInput);
28 $objectManagerProvider = $this->createMock(\
Magento\
Setup\Model\ObjectManagerProvider::class);
30 $this->getMockForAbstractClass(\
Magento\Framework\ObjectManagerInterface::class, [],
'',
false);
31 $cleanupFiles = $this->createMock(\
Magento\Framework\
App\
State\CleanupFiles::class);
34 [ \Magento\Framework\Module\PackageInfoFactory::class],
35 [ \Magento\Framework\App\State\CleanupFiles::class, $cleanupFiles],
36 [ \Magento\Framework\App\Cache::class,
$cache],
38 $objectManager->expects($this->atLeastOnce())->method(
'get')->will($this->returnValueMap($valueMap));
39 $objectManagerProvider->expects($this->once())->method(
'get')->willReturn(
$objectManager);
42 $this->getMockForAbstractClass(\Symfony\Component\Console\Output\OutputInterface::class, [],
'',
false);
44 $command = $this->createMock($commandClass);
46 $command->expects($this->once())
50 $definition =
new InputDefinition([
51 new InputArgument(
'types', InputArgument::REQUIRED),
52 new InputArgument(
'command', InputArgument::REQUIRED),
55 $inputDef = $this->createMock(\Symfony\Component\Console\Input\InputDefinition::class);
56 $inputDef->expects($this->any())->method(
'hasArgument')->willReturn(
true);
57 $command->expects($this->any())->method(
'getDefinition')->willReturn($inputDef);
58 $command->expects($this->any())->method(
'setDefinition')->with($definition);
71 \Magento\Backend\Console\Command\CacheEnableCommand::class,
72 [
'command' =>
'cache:enable',
'types' => [
'cache1']],
77 \Magento\Backend\Console\Command\CacheDisableCommand::class,
78 [
'command' =>
'cache:disable'],
79 'setup:cache:disable',
testSetCache($commandClass, $arrayInput, $jobName, $params)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]