Skip to content

Commit 0ee021a

Browse files
committed
MAGETWO-52000: [Github][PR]impossible to see what is wrong with cron - unhelpful error message #3189
- fixing test.
1 parent 4d72930 commit 0ee021a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

setup/src/Magento/Setup/Test/Unit/Model/Cron/JobSetCacheTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class JobSetCacheTest extends \PHPUnit_Framework_TestCase
1515
/**
1616
* @dataProvider setCacheDataProvider
1717
* @param string $commandClass
18-
* @param string $commandName
18+
* @param string $arrayInput
1919
* @param string $jobName
2020
* @param array $params
2121
*/
22-
public function testSetCache($commandClass, $commandName, $jobName, $params)
22+
public function testSetCache($commandClass, $arrayInput, $jobName, $params)
2323
{
2424
$objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
2525
$objectManager = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface', [], '', false);
@@ -32,12 +32,14 @@ public function testSetCache($commandClass, $commandName, $jobName, $params)
3232
];
3333
$objectManager->expects($this->atLeastOnce())->method('get')->will($this->returnValueMap($valueMap));
3434
$objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager);
35+
3536
$output = $this->getMockForAbstractClass('Symfony\Component\Console\Output\OutputInterface', [], '', false);
3637
$status = $this->getMock('Magento\Setup\Model\Cron\Status', [], [], '', false);
3738
$command = $this->getMock($commandClass, [], [], '', false);
39+
3840
$command->expects($this->once())
3941
->method('run')
40-
->with(new ArrayInput(['command' => $commandName, 'types' => $params]), $output);
42+
->with($arrayInput, $output);
4143

4244
$definition = new InputDefinition([
4345
new InputArgument('types', InputArgument::REQUIRED),
@@ -54,9 +56,11 @@ public function testSetCache($commandClass, $commandName, $jobName, $params)
5456
*/
5557
public function setCacheDataProvider()
5658
{
59+
$cacheEnable = new ArrayInput(['command' => 'cache:enable', 'types' => ['cache1']]);
60+
$cacheDisable = new ArrayInput(['command' => 'cache:disable']);
5761
return [
58-
['Magento\Backend\Console\Command\CacheEnableCommand', 'cache:enable', 'setup:cache:enable', ['cache1']],
59-
['Magento\Backend\Console\Command\CacheDisableCommand', 'cache:disable', 'setup:cache:disable', []],
62+
['Magento\Backend\Console\Command\CacheEnableCommand', $cacheEnable, 'setup:cache:enable', ['cache1']],
63+
['Magento\Backend\Console\Command\CacheDisableCommand', $cacheDisable, 'setup:cache:disable', []],
6064
];
6165
}
6266
}

0 commit comments

Comments
 (0)