@@ -12,7 +12,7 @@ class JobUpgradeTest extends \PHPUnit_Framework_TestCase
12
12
public function testExecute ()
13
13
{
14
14
$ queue = $ this ->getMock ('Magento\Setup\Model\Cron\Queue ' , [], [], '' , false );
15
- $ queue ->expects ($ this ->exactly (3 ))->method ('addJobs ' );
15
+ $ queue ->expects ($ this ->exactly (2 ))->method ('addJobs ' );
16
16
$ command = $ this ->getMock ('Magento\Setup\Console\Command\UpgradeCommand ' , [], [], '' , false );
17
17
$ command ->expects ($ this ->once ())->method ('run ' );
18
18
$ status = $ this ->getMock ('Magento\Setup\Model\Cron\Status ' , [], [], '' , false );
@@ -21,30 +21,6 @@ public function testExecute()
21
21
$ objectManagerProvider = $ this ->getMock ('Magento\Setup\Model\ObjectManagerProvider ' , ['get ' ], [], '' , false );
22
22
$ objectManagerProvider ->expects ($ this ->once ())->method ('get ' )->willReturn ($ objectManager );
23
23
24
- $ cleanupFiles = $ this ->getMock ('\Magento\Framework\App\State\CleanupFiles ' , [], [], '' , false );
25
- $ cache = $ this ->getMock ('\Magento\Framework\App\Cache ' , [], [], '' , false );
26
-
27
- $ pathToCacheStatus = '/path/to/cachefile ' ;
28
- $ writeFactory = $ this ->getMock ('\Magento\Framework\Filesystem\Directory\WriteFactory ' , [], [], '' , false );
29
- $ write = $ this ->getMock ('\Magento\Framework\Filesystem\Directory\Write ' , [], [], '' , false );
30
- $ write ->expects ($ this ->once ())->method ('isExist ' )->with ('/path/to/cachefile ' )->willReturn (true );
31
- $ write ->expects ($ this ->once ())->method ('readFile ' )->with ('/path/to/cachefile ' )->willReturn (
32
- '{"cacheOne":1,"cacheTwo":1,"cacheThree":1} '
33
- );
34
- $ write ->expects ($ this ->once ())->method ('delete ' )->with ('/path/to/cachefile ' )->willReturn (true );
35
- $ write ->expects ($ this ->once ())->method ('getRelativePath ' )->willReturn ($ pathToCacheStatus );
36
-
37
- $ writeFactory ->expects ($ this ->once ())->method ('create ' )->willReturn ($ write );
38
- $ directoryList = $ this ->getMock ('\Magento\Framework\App\Filesystem\DirectoryList ' , [], [], '' , false );
39
- $ directoryList ->expects ($ this ->once ())->method ('getPath ' )->willReturn ('/some/full/path ' . $ pathToCacheStatus );
40
-
41
- $ objectManager ->expects ($ this ->any ())->method ('get ' )->will ($ this ->returnValueMap ([
42
- ['\Magento\Framework\Filesystem\Directory\WriteFactory ' , $ writeFactory ],
43
- ['\Magento\Framework\App\Filesystem\DirectoryList ' , $ directoryList ],
44
- ['\Magento\Framework\App\State\CleanupFiles ' , $ cleanupFiles ],
45
- ['\Magento\Framework\App\Cache ' , $ cache ],
46
- ]));
47
-
48
24
$ jobUpgrade = new JobUpgrade (
49
25
$ command ,
50
26
$ objectManagerProvider ,
0 commit comments