@@ -15,11 +15,11 @@ class JobSetCacheTest extends \PHPUnit_Framework_TestCase
15
15
/**
16
16
* @dataProvider setCacheDataProvider
17
17
* @param string $commandClass
18
- * @param string $commandName
18
+ * @param string $arrayInput
19
19
* @param string $jobName
20
20
* @param array $params
21
21
*/
22
- public function testSetCache ($ commandClass , $ commandName , $ jobName , $ params )
22
+ public function testSetCache ($ commandClass , $ arrayInput , $ jobName , $ params )
23
23
{
24
24
$ objectManagerProvider = $ this ->getMock ('Magento\Setup\Model\ObjectManagerProvider ' , [], [], '' , false );
25
25
$ objectManager = $ this ->getMockForAbstractClass ('Magento\Framework\ObjectManagerInterface ' , [], '' , false );
@@ -32,12 +32,14 @@ public function testSetCache($commandClass, $commandName, $jobName, $params)
32
32
];
33
33
$ objectManager ->expects ($ this ->atLeastOnce ())->method ('get ' )->will ($ this ->returnValueMap ($ valueMap ));
34
34
$ objectManagerProvider ->expects ($ this ->once ())->method ('get ' )->willReturn ($ objectManager );
35
+
35
36
$ output = $ this ->getMockForAbstractClass ('Symfony\Component\Console\Output\OutputInterface ' , [], '' , false );
36
37
$ status = $ this ->getMock ('Magento\Setup\Model\Cron\Status ' , [], [], '' , false );
37
38
$ command = $ this ->getMock ($ commandClass , [], [], '' , false );
39
+
38
40
$ command ->expects ($ this ->once ())
39
41
->method ('run ' )
40
- ->with (new ArrayInput ([ ' command ' => $ commandName , ' types ' => $ params ]) , $ output );
42
+ ->with ($ arrayInput , $ output );
41
43
42
44
$ definition = new InputDefinition ([
43
45
new InputArgument ('types ' , InputArgument::REQUIRED ),
@@ -54,9 +56,11 @@ public function testSetCache($commandClass, $commandName, $jobName, $params)
54
56
*/
55
57
public function setCacheDataProvider ()
56
58
{
59
+ $ cacheEnable = new ArrayInput (['command ' => 'cache:enable ' , 'types ' => ['cache1 ' ]]);
60
+ $ cacheDisable = new ArrayInput (['command ' => 'cache:disable ' ]);
57
61
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 ' , []],
60
64
];
61
65
}
62
66
}
0 commit comments