diff --git a/lib/internal/Magento/Framework/Module/ModuleList.php b/lib/internal/Magento/Framework/Module/ModuleList.php index 126f95663db70a826954d72f8fd9ff55c4cc11aa..fb1fb8de06d17410724097d94d1350ff0078e5ff 100644 --- a/lib/internal/Magento/Framework/Module/ModuleList.php +++ b/lib/internal/Magento/Framework/Module/ModuleList.php @@ -139,6 +139,7 @@ class ModuleList implements ModuleListInterface */ private function loadConfigData() { + $this->config->resetData(); if (null === $this->configData && null !== $this->config->get(ConfigOptionsListConstants::KEY_MODULES)) { $this->configData = $this->config->get(ConfigOptionsListConstants::KEY_MODULES); } diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/ModuleListTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/ModuleListTest.php index 3d8eaa35261e7d05fd3637c1432206481e68e9b5..7f78420c4fc995478cfe02e7e594758dee9e76c9 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/ModuleListTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/ModuleListTest.php @@ -47,6 +47,7 @@ class ModuleListTest extends \PHPUnit_Framework_TestCase public function testGetAll() { + $this->config->expects($this->exactly(2))->method('resetData'); $this->setLoadAllExpectation(); $this->setLoadConfigExpectation(); $expected = ['foo' => self::$allFixture['foo']]; @@ -64,6 +65,7 @@ class ModuleListTest extends \PHPUnit_Framework_TestCase public function testGetOne() { + $this->config->expects($this->exactly(2))->method('resetData'); $this->setLoadAllExpectation(); $this->setLoadConfigExpectation(); $this->assertSame(['key' => 'value'], $this->model->getOne('foo')); @@ -72,6 +74,7 @@ class ModuleListTest extends \PHPUnit_Framework_TestCase public function testGetNames() { + $this->config->expects($this->exactly(2))->method('resetData'); $this->setLoadAllExpectation(false); $this->setLoadConfigExpectation(); $this->assertSame(['foo'], $this->model->getNames()); @@ -80,6 +83,7 @@ class ModuleListTest extends \PHPUnit_Framework_TestCase public function testHas() { + $this->config->expects($this->exactly(2))->method('resetData'); $this->setLoadAllExpectation(false); $this->setLoadConfigExpectation(); $this->assertTrue($this->model->has('foo')); @@ -88,6 +92,7 @@ class ModuleListTest extends \PHPUnit_Framework_TestCase public function testIsModuleInfoAvailable() { + $this->config->expects($this->once())->method('resetData'); $this->setLoadConfigExpectation(true); $this->assertTrue($this->model->isModuleInfoAvailable()); }