/** * testRender * * @since 3.0.0 * * @param array $searchArray * @param array $expectArray * * @dataProvider providerRender */ public function testRender($searchArray = [], $expectArray = []) { /* setup */ $resultList = new View\ResultList($this->_registry, $this->_language); $controllerSearch = new Controller\Search($this->_registry, $this->_language, $this->_request); $resultArray = $this->callMethod($controllerSearch, '_search', [$searchArray]); /* actual */ $actualArray = $resultList->render($resultArray); /* compare */ $this->assertEquals($expectArray, $actualArray); }
/** * render the result * * @since 3.0.0 * * @param array $resultArray array of the result * * @return string */ protected function _renderResult($resultArray = []) { $searchList = new View\ResultList($this->_registry, $this->_language); return $searchList->render($resultArray); }