You are here

protected function DataTestCaseUI::formatEditFields in Data 7

Same name and namespace in other branches
  1. 6 data_ui/tests/data_ui.test \DataTestCaseUI::formatEditFields()

Format an edit array from the result of randomFields().

1 call to DataTestCaseUI::formatEditFields()
DataTestCaseUI::createTable in data_ui/tests/data_ui.test
Create a table.

File

data_ui/tests/data_ui.test, line 225

Class

DataTestCaseUI
Test basic Data API functionality.

Code

protected function formatEditFields($fields) {
  $edit = array();
  $fields = array_values($fields);
  foreach ($fields as $i => $field) {
    foreach ($field as $k => $v) {
      $edit["fields[field_{$i}][{$k}]"] = $v;
    }
  }
  return $edit;
}