protected function _requireVisitorWithTwoProducts() { $visitor = new Mage_Log_Model_Visitor(); $visitor->setSessionId(md5(time()) . md5(microtime()))->setLastVisitAt(now())->save(); $item = new Mage_Catalog_Model_Product_Compare_Item(); $item->setVisitorId($visitor->getId())->setProductId(1)->save(); $item = new Mage_Catalog_Model_Product_Compare_Item(); $item->setVisitorId($visitor->getId())->setProductId(2)->save(); Mage::getSingleton('Mage_Log_Model_Visitor')->load($visitor->getId()); $this->_assertCompareListEquals(array(1, 2)); }