Example #1
0
 public function testIsValueChanged()
 {
     // load the model
     $collection = new Mage_Core_Model_Resource_Config_Data_Collection();
     $collection->addFieldToFilter('path', self::SAMPLE_CONFIG_PATH)->addFieldToFilter('scope_id', 0)->addFieldToFilter('scope', 'default');
     foreach ($collection as $configData) {
         $this->_model = $configData;
         break;
     }
     $this->assertNotEmpty($this->_model->getId());
     // assert
     $this->assertFalse($this->_model->isValueChanged());
     $this->_model->setValue(uniqid());
     $this->assertTrue($this->_model->isValueChanged());
 }
 /**
  * Get core config data collection
  *
  * @return Mage_Core_Model_Resource_Config_Data_Collection
  */
 protected function _getConfigDataCollection()
 {
     if (null === $this->_configDataCollection) {
         $this->_configDataCollection = Mage::getModel('core/resource_config_data_collection');
     } else {
         $this->_configDataCollection->clear()->getSelect()->reset();
     }
     return $this->_configDataCollection;
 }