function LocationTestCase::addLocationContentType in Location 7.4
Same name and namespace in other branches
- 6.3 tests/location_testcase.php \LocationTestCase::addLocationContentType()
- 7.5 tests/location_testcase.php \LocationTestCase::addLocationContentType()
- 7.3 tests/location_testcase.test \LocationTestCase::addLocationContentType()
6 calls to LocationTestCase::addLocationContentType()
1 method overrides LocationTestCase::addLocationContentType()
File
- tests/
location_testcase.php, line 98 - Common functions for Location tests.
Class
Code
function addLocationContentType(&$settings, $add = array()) {
// find a non-existent random type name.
do {
$name = strtolower($this
->randomName(3, 'type_'));
} while (node_type_get_type($name));
// Get the (settable) defaults.
$defaults = $this
->getLocationFieldDefaults();
$settings = array(
'name' => $name,
'type' => $name,
'location_settings' => array(
'multiple' => array(
'max' => 1,
'add' => 1,
),
'form' => array(
'fields' => $defaults,
),
),
);
//$settings['location_settings'] = array_merge_recursive($settings['location_settings'], $add);
$this
->flattenPostData($settings);
$add = array(
'location_settings' => $add,
);
$this
->flattenPostData($add);
$settings = array_merge($settings, $add);
$this
->drupalPost('admin/content/types/add', $settings, 'Save content type');
$this
->refreshVariables();
$settings = variable_get('location_settings_node_' . $name, array());
return $name;
}