/** * @magentoDataFixture Mage/Review/_files/different_reviews.php */ public function testGetResultingIds() { $collection = new Mage_Review_Model_Resource_Review_Product_Collection(); $collection->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED); $actual = $collection->getResultingIds(); $this->assertCount(2, $actual); }
/** * Test getResultingIds * 1) check that filter was applied * 2) check that elements are ordered correctly * * @magentoDataFixtureDisabled Mage/Review/_files/different_reviews.php */ public function testGetResultingIds() { $this->markTestIncomplete('Bug MAGETWO-2595'); $collection = new Mage_Review_Model_Resource_Review_Product_Collection(); $collection->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)->setOrder('rdt.title', Mage_Review_Model_Resource_Review_Product_Collection::SORT_ORDER_ASC); $actual = $collection->getResultingIds(); $this->assertCount(2, $actual); $this->assertLessThan($actual[0], $actual[1]); }
/** * Gets collection items count * * @return int */ public function count() { return $this->_collection->getSize(); }
protected function _initCollection() { $this->_collection = Mage::getModel('Mage_Review_Model_Review')->getProductCollection(); $this->_collection->addStoreFilter(Mage::app()->getStore()->getId())->addCustomerFilter(Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerId())->setDateOrder(); return $this; }