public function testRemoveItemsByPresentAndAbsentParams() { $items = $this->addItems(); $presentAndAbsentParams = ['message', 'noneparam']; $result = $this->listStatus->removeItemsByParams($presentAndAbsentParams); $this->assertEquals($items, $result); }
/** * Removes error infos, that have parameters equal to passed in $params. * $params can have following keys (if not set - then any item is good for this key): * 'origin', 'code', 'message' * * @param array $params * @return $this */ public function removeErrorInfosByParams($params) { $removedItems = $this->_errorInfos->removeItemsByParams($params); foreach ($removedItems as $item) { if ($item['message'] !== null) { $this->removeMessageByText($item['message']); } } if (!$this->_errorInfos->getItems()) { $this->_setHasError(false); } return $this; }