public function testSaveEmptiesNonSetArguments() { $this->_structureReaderMock->expects($this->never())->method('getConfiguration'); $this->assertNull($this->_model->getSection()); $this->assertNull($this->_model->getWebsite()); $this->assertNull($this->_model->getStore()); $this->_model->save(); $this->assertSame('', $this->_model->getSection()); $this->assertSame('', $this->_model->getWebsite()); $this->assertSame('', $this->_model->getStore()); }
public function aroundSave(\Magento\Config\Model\Config $config, \Closure $proceed) { $ret = $proceed(); $sectionId = $config->getSection(); if ($sectionId == 'mandrill' && !$config->getConfigDataValue('mandrill/general/active')) { $modules = $this->_loader->load(); if (isset($modules['Ebizmarts_AbandonedCart'])) { $this->_writer->save(\Ebizmarts\AbandonedCart\Model\Config::ACTIVE, 0, $config->getScope(), $config->getScopeId()); } if (isset($modules['Ebizmarts_AutoResponder'])) { $this->_writer->save(\Ebizmarts\AutoResponder\Model\Config::ACTIVE, 0, $config->getScope(), $config->getScopeId()); } } return $ret; }