/**
  * 
  * Update the data with the given failure
  * @param unitTestDataFile $unitTestData
  * @param KalturaTestsFailures $testsFailures
  * @return unitTestDataFile - The new unitTestDataFile with the changes
  */
 private static function update(KalturaUnitTestDataFile $unitTestDataFile, KalturaTestFailures $testsFailures)
 {
     //Maybe a bug because of shallow copy, but currently we don't need the old object after the copy
     //So bug can't be checked
     $newUnitTestDataFile = clone $unitTestDataFile;
     //TODO: Change the new file according to the error file
     //For each failure
     foreach ($testsFailures->failures as $singleInputFailures) {
         //Find the right input
         $unitTestDataKey = KalturaUnitTestResultUpdater::getTestKeyByInputs($newUnitTestDataFile, $singleInputFailures->inputs);
         //Update the values by its failures
         foreach ($singleInputFailures->failures as $failure) {
             $field = $failure->field;
             $actualValue = $failure->actualValue;
             $outputReferenceObject = $newUnitTestDataFile->unitTestsData[$unitTestDataKey]->outputReference[0];
             //We update only the first output reference which is propel
             $outputReferenceObject->setByName($field, $actualValue);
             //if there are no dbValues yet we create the first ones
             if (!isset($outputReferenceObject->comments[$field])) {
                 $outputReferenceObject->comments[$field] = $failure->outputReferenceValue;
             }
         }
     }
     return $newUnitTestDataFile;
 }