You are here

function LocationCCKTest::testCreateLocation in Location 6.3

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

Create a location via cck.

File

tests/location_cck.test, line 129

Class

LocationCCKTest

Code

function testCreateLocation() {
  $settings = array();
  $location_type = $this
    ->addLocationContentType($settings);
  $location1_name = $this
    ->randomName();
  $node = $this
    ->drupalCreateNode(array(
    'type' => $location_type,
    'field_loctest' => array(
      array(
        'name' => $location1_name,
        'street' => '48072 289th St.',
        'province' => 'SD',
        'country' => 'us',
      ),
    ),
  ));
  cache_clear_all();

  // Reload the node.
  $node2 = node_load($node->nid, NULL, TRUE);
  $location = $node2->field_loctest[0];
  $this
    ->assertEqual($location1_name, $location['name'], t('Testing basic save/load'));
}