Skip to content

Commit d894c43

Browse files
committed
MAGETWO-43454: Contribute Ogre Sprint 38 Bugs and Tasks
- Fix integration test ComponentGridTest
1 parent 66b3031 commit d894c43

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,23 @@ public function setUp()
111111
$objectManagerProvider->expects($this->once())
112112
->method('get')
113113
->willReturn($objectManager);
114-
$packageInfoFactory = $this->getMock('Magento\Framework\Module\PackageInfoFactory', [], [], '', false);
115-
$enabledModuleList = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
116-
$enabledModuleList->expects($this->any())->method('has')->willReturn(true);
117-
$fullModuleList = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
118-
$fullModuleList->expects($this->any())->method('getNames')->willReturn($allComponentData);
114+
$this->packageInfoFactoryMock = $this
115+
->getMock('Magento\Framework\Module\PackageInfoFactory', [], [], '', false);
116+
$this->enabledModuleListMock = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
117+
$this->enabledModuleListMock->expects($this->any())->method('has')->willReturn(true);
118+
$this->fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
119+
$this->fullModuleListMock->expects($this->any())->method('getNames')->willReturn($allComponentData);
119120
$objectManager->expects($this->exactly(3))
120121
->method('get')
121122
->willReturnMap([
122-
['Magento\Framework\Module\PackageInfoFactory', $packageInfoFactory],
123-
['Magento\Framework\Module\FullModuleList', $fullModuleList],
124-
['Magento\Framework\Module\ModuleList', $enabledModuleList]
123+
['Magento\Framework\Module\PackageInfoFactory', $this->packageInfoFactoryMock],
124+
['Magento\Framework\Module\FullModuleList', $this->fullModuleListMock],
125+
['Magento\Framework\Module\ModuleList', $this->enabledModuleListMock]
125126
]);
126127
$this->packageInfo = $this->getMock('Magento\Framework\Module\PackageInfo', [], [], '', false);
127128
$this->updatePackagesCacheMock = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false);
128129
$this->connectManagerMock = $this->getMock('Magento\Setup\Model\ConnectManager', [], [], '', false);
129-
$packageInfoFactory->expects($this->once())->method('create')->willReturn($this->packageInfo);
130+
$this->packageInfoFactoryMock->expects($this->once())->method('create')->willReturn($this->packageInfo);
130131
$this->controller = new ComponentGrid(
131132
$this->composerInformationMock,
132133
$objectManagerProvider,

0 commit comments

Comments
 (0)