protected function LocationTestCase::getLocationFieldDefaults in Location 7.3
Same name and namespace in other branches
- 6.3 tests/location_testcase.php \LocationTestCase::getLocationFieldDefaults()
- 7.5 tests/location_testcase.php \LocationTestCase::getLocationFieldDefaults()
- 7.4 tests/location_testcase.php \LocationTestCase::getLocationFieldDefaults()
Get a set of location field defaults. This will also enable collection on all parts of the location field.
1 call to LocationTestCase::getLocationFieldDefaults()
File
- tests/
location_testcase.test, line 43 - Common functions for Location tests.
Class
- LocationTestCase
- Class LocationTestCase.
Code
protected function getLocationFieldDefaults() {
// Get the (settable) defaults.
$defaults = array();
$d = location_invoke_locationapi($location, 'defaults');
$fields = location_field_names();
foreach ($fields as $k => $v) {
if (!isset($d[$k]['nodiff'])) {
$defaults[$k] = $d[$k];
}
}
foreach ($defaults as $k => $v) {
// Change collection to allow.
$defaults[$k]['collect'] = 1;
}
return $defaults;
}