/** * The "After save" actions * * @return $this */ public function afterSave() { parent::afterSave(); if ($this->_oauthData->isCleanupProbability()) { $this->getResource()->deleteOldEntries($this->_oauthData->getCleanupExpirationPeriod()); } return $this; }
/** * The "After save" actions * * @return $this */ protected function _afterSave() { parent::_afterSave(); // Cleanup old entries if ($this->_oauthData->isCleanupProbability()) { $this->_getResource()->deleteOldEntries($this->_oauthData->getCleanupExpirationPeriod()); } return $this; }
public function testIsCleanupProbabilityRandomOne() { $this->_scopeConfigMock->expects($this->once())->method('getValue')->will($this->returnValue(1)); $this->assertTrue($this->_dataHelper->isCleanupProbability()); }