Beispiel #1
0
 /**
  * @param  null|FiltersFilter $data
  * @return null|void
  */
 public function filters($data = null)
 {
     $action = 'filters';
     $postMainParameters = null;
     if ($data instanceof FiltersFilter) {
         $this->addSecondaryParameter('item_type', $data->getItemType());
     } elseif (is_int($data)) {
         $this->addMainParameter($data);
     }
     $response = $this->call($action, $postMainParameters);
     $result = $this->handleResponse($response);
     return $result;
 }
Beispiel #2
0
 /**
  *
  */
 public function testFilters()
 {
     $ot = $this->getOnTimeObjectOk();
     $resultT1 = $ot->filters();
     $this->assertTrue(is_array($resultT1['data']));
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT2 = new Filters();
     $filterT2->setItemType('defects');
     $resultT2 = $ot->filters($filterT2);
     $this->assertTrue(is_array($resultT2['data']));
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT3 = new Filters();
     $filterT3->setItemType('features');
     $resultT3 = $ot->filters($filterT3);
     $this->assertTrue(is_array($resultT3['data']));
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT4 = new Filters();
     $filterT4->setItemType('incidents');
     $resultT4 = $ot->filters($filterT4);
     $this->assertTrue(is_array($resultT4['data']));
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT5 = new Filters();
     $filterT5->setItemType('tasks');
     $resultT5 = $ot->filters($filterT5);
     $this->assertTrue(is_array($resultT5['data']));
 }