You are here

function LocationCCKTest::testLocpickOnly in Location 6.3

Same name and namespace in other branches
  1. 7.5 tests/location_cck.test \LocationCCKTest::testLocpickOnly()
  2. 7.3 tests/location_cck.test \LocationCCKTest::testLocpickOnly()
  3. 7.4 tests/location_cck.test \LocationCCKTest::testLocpickOnly()

File

tests/location_cck.test, line 157

Class

LocationCCKTest

Code

function testLocpickOnly() {
  $settings = array();
  $location_type = $this
    ->addLocationContentType($settings);
  $location1_name = $this
    ->randomName();
  $node = $this
    ->drupalCreateNode(array(
    'type' => $location_type,
    'field_loctest' => array(
      array(
        'locpick' => array(
          'user_latitude' => '44.25',
          'user_longitude' => '-10.25',
        ),
      ),
    ),
  ));

  // Reload the node.
  $node2 = node_load($node->nid, NULL, TRUE);
  $this
    ->pass(var_export($node2->locations, TRUE));
  $this
    ->assertEqual($node2->field_loctest[0]['latitude'], 44.25, t('Testing coordinate-only save/load'));
}