You are here

function LocationTestCase::flattenPostData in Location 7.5

Same name and namespace in other branches
  1. 6.3 tests/location_testcase.php \LocationTestCase::flattenPostData()
  2. 7.3 tests/location_testcase.test \LocationTestCase::flattenPostData()
  3. 7.4 tests/location_testcase.php \LocationTestCase::flattenPostData()

Flatten a post settings array because drupalPost isn't smart enough to.

8 calls to LocationTestCase::flattenPostData()
CowInstanceTest::testCOWConservation in tests/cow.test
CowInstanceTest::testNodeRevisionCOW in tests/cow.test
LocationCCKTest::addLocationContentType in tests/location_cck.test
LocationCCKTest::testCOWConservation in tests/location_cck.test
LocationCCKTest::testNodeRevisionCleanup in tests/location_cck.test

... See full list

File

tests/location_testcase.php, line 51
Common functions for Location tests.

Class

LocationTestCase
@file Common functions for Location tests.

Code

function flattenPostData(&$edit) {
  do {
    $edit_flattened = TRUE;
    foreach ($edit as $k => $v) {
      if (is_array($v)) {
        $edit_flattened = FALSE;
        foreach ($v as $kk => $vv) {
          $edit["{$k}[{$kk}]"] = $vv;
        }
        unset($edit[$k]);
      }
    }
  } while (!$edit_flattened);
}