/** * Clean logs * * @param \Magento\Log\Model\Log $object * @return $this */ public function clean(\Magento\Log\Model\Log $object) { $cleanTime = $object->getLogCleanTime(); $this->_cleanVisitors($cleanTime); $this->_cleanCustomers($cleanTime); $this->_cleanUrls(); return $this; }
/** * Clean logs * * @return $this */ public function logClean() { if (!$this->_scopeConfig->isSetFlag(self::XML_PATH_LOG_CLEAN_ENABLED, \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) { return $this; } $this->_errors = array(); try { $this->_log->clean(); } catch (\Exception $e) { $this->_errors[] = $e->getMessage(); $this->_errors[] = $e->getTrace(); } $this->_sendLogCleanEmail(); return $this; }
public function testGetOnlineMinutesInterval() { $this->scopeConfig->expects($this->once())->method('getValue')->with('customer/online_customers/online_minutes_interval', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)->will($this->returnValue(10)); $this->assertEquals(10, $this->log->getOnlineMinutesInterval()); }