function CowInstanceTest::testCOWConservation in Location 7.5
Same name and namespace in other branches
- 6.3 tests/cow.test \CowInstanceTest::testCOWConservation()
- 7.3 tests/cow.test \CowInstanceTest::testCOWConservation()
- 7.4 tests/cow.test \CowInstanceTest::testCOWConservation()
File
- tests/
cow.test, line 254
Class
Code
function testCOWConservation() {
$settings = array();
$location_type = $this
->addLocationContentType($settings);
$location1_name = $this
->randomName();
$node = $this
->drupalCreateNode(array(
'type' => $location_type,
'locations' => array(
0 => array(
'name' => $location1_name,
'location_settings' => $settings,
),
),
));
// Reload the node.
$node = node_load($node->nid, NULL, TRUE);
$changes = array(
'locations' => array(
0 => array(
// Update name.
'name' => $location1_name . '_CHANGE',
),
),
);
$this
->flattenPostData($changes);
$this
->drupalPost('node/' . $node->nid . '/edit', $changes, 'Save');
// Reload the node again.
$node1 = node_load($node->nid, NULL, TRUE);
// Ensure locations are in a consistent order.
$this
->reorderLocations($node);
$this
->reorderLocations($node1);
$this
->assertEqual($node->locations[0]['lid'], $node1->locations[0]['lid'], t('Ensuring LIDs are conserved'));
}