Exemple #1
0
 public function testRemoveItemsByPresentAndAbsentParams()
 {
     $items = $this->addItems();
     $presentAndAbsentParams = ['message', 'noneparam'];
     $result = $this->listStatus->removeItemsByParams($presentAndAbsentParams);
     $this->assertEquals($items, $result);
 }
Exemple #2
0
 /**
  * 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;
 }