Example #1
0
 /**
  * @return Decimal
  */
 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);
     return $this->_model;
 }
Example #2
0
 public function testItemData()
 {
     $this->fulltextCollection->expects($this->any())->method('getSize')->willReturn(5);
     $this->fulltextCollection->expects($this->any())->method('getFacetedData')->willReturn(['2_10' => ['count' => 5], '*_*' => ['count' => 2]]);
     $this->assertEquals([$this->filterItem], $this->target->getItems());
 }
Example #3
0
 /**
  * Decimal constructor.
  *
  * @param \Magento\Catalog\Model\Layer\Filter\ItemFactory                  $filterItemFactory    Filter item
  *                                                                                               factory
  * @param \Magento\Store\Model\StoreManagerInterface                       $storeManager         The Store Manager
  * @param \Magento\Catalog\Model\Layer                                     $layer                The Layer
  * @param \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder             $itemDataBuilder      The data builder
  * @param \Magento\Catalog\Model\ResourceModel\Layer\Filter\DecimalFactory $filterDecimalFactory Factory for
  *                                                                                               decimal items
  * @param \Magento\Framework\Pricing\PriceCurrencyInterface                $priceCurrency        Price Currency
  * @param \Magento\Catalog\Model\Layer\Filter\DataProvider\PriceFactory    $dataProviderFactory  Price DataProvider
  *                                                                                               Factory
  * @param \Magento\Framework\Locale\ResolverInterface                      $localeResolver       Locale Resolver
  * @param array                                                            $data                 Filter Data
  */
 public function __construct(\Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Layer $layer, \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder, \Magento\Catalog\Model\ResourceModel\Layer\Filter\DecimalFactory $filterDecimalFactory, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\Catalog\Model\Layer\Filter\DataProvider\PriceFactory $dataProviderFactory, \Magento\Framework\Locale\ResolverInterface $localeResolver, array $data)
 {
     parent::__construct($filterItemFactory, $storeManager, $layer, $itemDataBuilder, $filterDecimalFactory, $priceCurrency, $data);
     $this->localeResolver = $localeResolver;
     $this->dataProvider = $dataProviderFactory->create(['layer' => $this->getLayer()]);
 }