You are here

function CowInstanceTest::testLocpickOnly in Location 6.3

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

File

tests/cow.test, line 63

Class

CowInstanceTest

Code

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

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