@@ -42,22 +42,35 @@ class CronTest extends \PHPUnit_Framework_TestCase
42
42
43
43
protected function setUp ()
44
44
{
45
- $ this ->_stateMock = $ this ->getMock (' Magento\Framework\App\State ' , [], [], '' , false );
46
- $ this ->_request = $ this ->getMock (' Magento\Framework\App\Console\Request ' , [], [], '' , false );
47
- $ this ->_responseMock = $ this ->getMock (' Magento\Framework\App\Console\Response ' , [], [], '' , false );
48
- $ this ->objectManager = $ this ->getMockForAbstractClass (' Magento\Framework\ObjectManagerInterface ' );
45
+ $ this ->_stateMock = $ this ->getMock (\ Magento \Framework \App \State::class , [], [], '' , false );
46
+ $ this ->_request = $ this ->getMock (\ Magento \Framework \App \Console \Request::class , [], [], '' , false );
47
+ $ this ->_responseMock = $ this ->getMock (\ Magento \Framework \App \Console \Response::class , [], [], '' , false );
48
+ $ this ->objectManager = $ this ->getMockForAbstractClass (\ Magento \Framework \ObjectManagerInterface::class );
49
49
$ this ->_model = new Cron ($ this ->_stateMock , $ this ->_request , $ this ->_responseMock , $ this ->objectManager );
50
50
}
51
51
52
52
public function testLaunchDispatchesCronEvent ()
53
53
{
54
- $ configLoader = $ this ->getMockForAbstractClass ('Magento\Framework\ObjectManager\ConfigLoaderInterface ' );
55
- $ eventManagerMock = $ this ->getMock ('Magento\Framework\Event\ManagerInterface ' );
54
+ $ configLoader = $ this ->getMockForAbstractClass (\Magento \Framework \ObjectManager \ConfigLoaderInterface::class);
55
+ $ eventManagerMock = $ this ->getMock (\Magento \Framework \Event \ManagerInterface::class);
56
+
57
+ $ areaMock = $ this ->getMock (\Magento \Framework \App \Area::class, [], [], '' , false );
58
+ $ areaMock ->expects ($ this ->once ())
59
+ ->method ('load ' )
60
+ ->with (Area::PART_TRANSLATE );
61
+
62
+ $ areaListMock = $ this ->getMock (\Magento \Framework \App \AreaList::class, [], [], '' , false );
63
+ $ areaListMock ->expects ($ this ->any ())
64
+ ->method ('getArea ' )
65
+ ->with (Area::AREA_CRONTAB )
66
+ ->willReturn ($ areaMock );
67
+
56
68
$ this ->objectManager ->expects ($ this ->any ())
57
69
->method ('get ' )
58
70
->will ($ this ->returnValueMap ([
59
- ['Magento\Framework\ObjectManager\ConfigLoaderInterface ' , $ configLoader ],
60
- ['Magento\Framework\Event\ManagerInterface ' , $ eventManagerMock ],
71
+ [\Magento \Framework \ObjectManager \ConfigLoaderInterface::class, $ configLoader ],
72
+ [\Magento \Framework \Event \ManagerInterface::class, $ eventManagerMock ],
73
+ [\Magento \Framework \App \AreaList::class, $ areaListMock ]
61
74
]));
62
75
$ crontabConfig = ['config ' ];
63
76
$ configLoader ->expects ($ this ->once ())
0 commit comments