Skip to content
Snippets Groups Projects
Commit 6e1be455 authored by Maddy Chellathurai's avatar Maddy Chellathurai Committed by Olga Kopylova
Browse files

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
parent f19f9732
Branches
No related merge requests found
......@@ -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);
}
......
......@@ -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());
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment