You are here

public function CowInstanceTest::testLocpickOnly in Location 7.3

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

File

tests/cow.test, line 68

Class

CowInstanceTest
Class CowInstanceTest.

Code

public 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'));
}