public function setUp() { $this->form = $this->getMock('Symfony\\Component\\Form\\Test\\FormInterface'); $this->formFactory = $this->getMock('Symfony\\Component\\Form\\FormFactoryInterface'); $this->formFactory->expects($this->any())->method('create')->will($this->returnValue($this->form)); $this->filterUtility = $this->getMockBuilder('Oro\\Bundle\\FilterBundle\\Filter\\FilterUtility')->disableOriginalConstructor()->getMock(); $this->filterUtility->expects($this->any())->method('getExcludeParams')->willReturn([]); $this->formatter = $this->getMockBuilder('OroB2B\\Bundle\\ProductBundle\\Formatter\\ProductUnitLabelFormatter')->disableOriginalConstructor()->getMock(); $this->productPriceFilter = new ProductPriceFilter($this->formFactory, $this->filterUtility, $this->formatter); }
/** * Process mapping params * * @param array $params * * @return array */ protected function mapParams($params) { $keys = []; $paramMap = $this->util->getParamMap(); foreach (array_keys($params) as $key) { if (isset($paramMap[$key])) { $keys[] = $paramMap[$key]; } else { $keys[] = $key; } } return array_combine($keys, array_values($params)); }