Ejemplo n.º 1
0
 public function testApply()
 {
     /** @var $objectManager \Magento\TestFramework\ObjectManager */
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     /** @var $request \Magento\TestFramework\Request */
     $request = $objectManager->get('Magento\\TestFramework\\Request');
     $request->setParam('decimal', '1,100');
     $this->_model->apply($request);
 }
Ejemplo n.º 2
0
 /**
  * Retrieve clean select with joined index table
  * Joined table has index
  *
  * @param \Magento\Catalog\Model\Layer\Filter\Decimal $filter
  * @return \Magento\Framework\DB\Select
  */
 protected function _getSelect($filter)
 {
     $collection = $filter->getLayer()->getProductCollection();
     // clone select from collection with filters
     $select = clone $collection->getSelect();
     // reset columns, order and limitation conditions
     $select->reset(\Zend_Db_Select::COLUMNS);
     $select->reset(\Zend_Db_Select::ORDER);
     $select->reset(\Zend_Db_Select::LIMIT_COUNT);
     $select->reset(\Zend_Db_Select::LIMIT_OFFSET);
     $attributeId = $filter->getAttributeModel()->getId();
     $storeId = $collection->getStoreId();
     $select->join(array('decimal_index' => $this->getMainTable()), 'e.entity_id = decimal_index.entity_id' . ' AND ' . $this->_getReadAdapter()->quoteInto('decimal_index.attribute_id = ?', $attributeId) . ' AND ' . $this->_getReadAdapter()->quoteInto('decimal_index.store_id = ?', $storeId), array());
     return $select;
 }
Ejemplo n.º 3
0
 /**
  * @dataProvider getRangeItemCountsDataProvider
  */
 public function testGetRangeItemCounts($inputRange, $expectedItemCounts)
 {
     $this->assertEquals($expectedItemCounts, $this->_model->getRangeItemCounts($inputRange));
 }