From 6e1be45537338f6f8994cad3d906eb8c867bc110 Mon Sep 17 00:00:00 2001
From: Maddy Chellathurai <mchellathura@ebay.com>
Date: Thu, 29 Oct 2015 16:06:04 -0500
Subject: [PATCH] MAGETWO-44736: Contribute Ogres Bugfixes

- adding reset to so that behavior is consistent with isAvailable which reloads data.
- fix specifcally for sample data installation build
---
 lib/internal/Magento/Framework/Module/ModuleList.php         | 1 +
 .../Magento/Framework/Module/Test/Unit/ModuleListTest.php    | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/lib/internal/Magento/Framework/Module/ModuleList.php b/lib/internal/Magento/Framework/Module/ModuleList.php
index 126f95663db..fb1fb8de06d 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 3d8eaa35261..7f78420c4fc 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());
     }
-- 
GitLab