function test_AggregatorResult_stores_data()
 {
     $result = new tx_caretaker_AggregatorResult(123, 2, 2, 1, 3, 5, 'This is a Message');
     $this->assertEquals($result->getTimestamp(), 123);
     $this->assertEquals($result->getState(), 2);
     $this->assertEquals($result->getStateInfo(), 'ERROR');
     $this->assertEquals($result->getMessage()->getText(), 'This is a Message');
     $this->assertEquals($result->getNumUNDEFINED(), 2);
     $this->assertEquals($result->getNumOK(), 1);
     $this->assertEquals($result->getNumWARNING(), 3);
     $this->assertEquals($result->getNumERROR(), 5);
 }
 /**
  * Save Aggregator Result to the DB
  *
  * @param tx_caretaker_AggregatorNode $node
  * @param tx_caretaker_AggregatorResult $aggregator_result
  * @return integer UID of the new DB result Record
  */
 public function addNodeResult(tx_caretaker_AggregatorNode $node, tx_caretaker_AggregatorResult $aggregator_result)
 {
     //add an undefined row to the testresult column
     $instance = $node->getInstance();
     if ($instance) {
         $instanceUid = $instance->getUid();
     } else {
         $instanceUid = 0;
     }
     $values = array('aggregator_uid' => $node->getUid(), 'aggregator_type' => $node->getType(), 'instance_uid' => $instanceUid, 'result_status' => $aggregator_result->getState(), 'tstamp' => $aggregator_result->getTstamp(), 'result_num_undefined' => $aggregator_result->getNumUNDEFINED(), 'result_num_ok' => $aggregator_result->getNumOK(), 'result_num_warnig' => $aggregator_result->getNumWARNING(), 'result_num_error' => $aggregator_result->getNumERROR(), 'result_msg' => $aggregator_result->getMessage()->getText(), 'result_values' => serialize($aggregator_result->getMessage()->getValues()), 'result_submessages' => serialize($aggregator_result->getSubMessages()));
     $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_caretaker_aggregatorresult', $values);
     return $GLOBALS['TYPO3_DB']->sql_insert_id();
 }