Skip to content

Commit d9d4ae0

Browse files
Safwan KhanOlga Kopylova
authored andcommitted
MAGETWO-33205: Help command in Setup CLI for list of modules
- Added testcase for the change.
1 parent 4ba8358 commit d9d4ae0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

dev/tests/unit/testsuite/Magento/Setup/Controller/ConsoleControllerTest.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,37 @@ public function helpActionForLanguageCurrencyTimezoneDataProvider()
264264
];
265265
}
266266

267+
public function testHelpActionForModuleList()
268+
{
269+
$this->request->expects($this->once())->method('getParam')->willReturn(ConsoleController::HELP_LIST_OF_MODULES);
270+
$moduleListMock = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
271+
$moduleListMock
272+
->expects($this->once())
273+
->method('getNames')
274+
->will($this->returnValue(['Magento_Core', 'Magento_Store']));
275+
$fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
276+
$fullModuleListMock
277+
->expects($this->once())
278+
->method('getNames')
279+
->will($this->returnValue(['Magento_Core', 'Magento_Store', 'Magento_Directory']));
280+
$returnValueMap = [
281+
[
282+
'Magento\Framework\Module\ModuleList',
283+
[],
284+
$moduleListMock,
285+
],
286+
[
287+
'Magento\Framework\Module\FullModuleList',
288+
[],
289+
$fullModuleListMock,
290+
],
291+
];
292+
$this->objectManager->expects($this->exactly(2))
293+
->method('create')
294+
->will($this->returnValueMap($returnValueMap));
295+
$this->controller->helpAction();
296+
}
297+
267298
public function testHelpActionNoType()
268299
{
269300
$beginHelpString = "\n==-------------------==\n"

0 commit comments

Comments
 (0)