Пример #1
0
 /**
  * try to add a Timesheet with custom fields
  *
  */
 public function testAddTimesheetWithCustomFields()
 {
     $value1 = 'abcd';
     $value2 = 'efgh';
     $cf = $this->_getCustomField();
     // create two timesheets with customfields
     $this->_addTsWithCf($cf, $value1);
     $this->_addTsWithCf($cf, $value2);
     // search custom field values and check totalcount
     $tinebaseJson = new Tinebase_Frontend_Json();
     $cfValues = $tinebaseJson->searchCustomFieldValues(Zend_Json::encode($this->_getCfValueFilter($cf->getId())), '');
     $this->assertEquals(2, $cfValues['totalcount'], 'wrong totalcount');
     $cfValueArray = array($cfValues['results'][0]['value'], $cfValues['results'][1]['value']);
     $this->assertTrue(in_array($value1, $cfValueArray));
     $this->assertTrue(in_array($value2, $cfValueArray));
 }