public function testGetSetCurrencyRate() { $this->assertEquals(1, $this->_model->getCurrencyRate()); $currencyRate = 42; $this->_model->setCurrencyRate($currencyRate); $this->assertEquals($currencyRate, $this->_model->getCurrencyRate()); }
/** * Constructor. * * @SuppressWarnings(PHPMD.ExcessiveParameterList) * * @param \Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory Item filter facotory. * @param \Magento\Store\Model\StoreManagerInterface $storeManager Store manager. * @param \Magento\Catalog\Model\Layer $layer Search layer. * @param \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder Item data builder. * @param \Magento\Catalog\Model\ResourceModel\Layer\Filter\Price $resource Price resource. * @param \Magento\Customer\Model\Session $customerSession Customer session. * @param \Magento\Framework\Search\Dynamic\Algorithm $priceAlgorithm Price algorithm. * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency Price currency. * @param \Magento\Catalog\Model\Layer\Filter\Dynamic\AlgorithmFactory $algorithmFactory Algorithm factory. * @param \Magento\Catalog\Model\Layer\Filter\DataProvider\PriceFactory $dataProviderFactory Data provider. * @param array $data Custom 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\Price $resource, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Search\Dynamic\Algorithm $priceAlgorithm, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\Catalog\Model\Layer\Filter\Dynamic\AlgorithmFactory $algorithmFactory, \Magento\Catalog\Model\Layer\Filter\DataProvider\PriceFactory $dataProviderFactory, array $data = []) { parent::__construct($filterItemFactory, $storeManager, $layer, $itemDataBuilder, $resource, $customerSession, $priceAlgorithm, $priceCurrency, $algorithmFactory, $dataProviderFactory, $data); $this->dataProvider = $dataProviderFactory->create(['layer' => $this->getLayer()]); $this->customerSession = $customerSession; $this->priceCurrency = $priceCurrency; }
public function testGetItems() { $this->target->setAttributeModel($this->attribute); $attributeCode = 'attributeCode'; $this->attribute->expects($this->any())->method('getAttributeCode')->will($this->returnValue($attributeCode)); $this->fulltextCollection->expects($this->once())->method('getFacetedData')->with($attributeCode)->will($this->returnValue([])); $this->target->getItems(); }