summaryrefslogtreecommitdiffstats
path: root/tests/location_cck.test
blob: 88838cc95cbd5f9ab851cc107fd313106671f849 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php

/**
 * @file
 * Tests for location_cck.module.
 */

require_once drupal_get_path('module', 'location') . '/tests/location_testcase.test';

/**
 * Class LocationCCKTest.
 */
class LocationCCKTest extends LocationCCK2Test {
  /**
   * A global administrative user.
   */
  public $admin_user;

  /**
   * A global normal user.
   */
  public $normal_user;

  /**
   * A default content type.
   */
  public $content_type;

  public static function getInfo() {
    return array(
      'name' => t('Location CCK checks(broken!!!)'),
      'description' => t('Test corner cases of the CCK Location module.'),
      'group' => t('Location', array(), array('context' => 'geolocation')),
    );
  }

  public function setUp() {
    parent::setUp('location', 'location_cck', 'devel', 'field_ui');
    $this->admin_user = $this->drupalCreateUser(array_keys(module_invoke_all('permission')));
    $this->normal_user = $this->drupalCreateUser(array('access content'));

    $this->drupalLogin($this->admin_user);
  }

  /**
   * @deprecated @see addLocationContentType2()
   * @param $settings
   * @param array $add
   * @return string
   */
  protected function addLocationContentType(&$settings, $add = array()) {

    $field_name = 'loctest';

    // Let the caller mess with some relevant cck stuff.
    $required = isset($add['cck_required']) ? $add['cck_required'] : FALSE;
    $multiple = isset($add['cck_multiple']) ? $add['cck_multiple'] : 0;
    unset($add['cck_required']);
    unset($add['cck_multiple']);

    // find a non-existent random type name.

    $name = strtolower($this->randomName(8));

    $form = array(
      'name' => $name,
      'type' => $name,
    );

    $this->flattenPostData($form);

    $this->drupalPost('admin/structure/types/add', $form, 'Save content type');
    $this->refreshVariables();

    $form = array(
      'fields[_add_new_field][label]' => 'Location',
      'fields[_add_new_field][field_name]' => $field_name,
      'fields[_add_new_field][type]' => 'location',
      'fields[_add_new_field][widget_type]' => 'location',
    );

    $this->drupalPost('admin/structure/types/manage/' . $name . '/fields', $form, 'Save');

    $this->refreshVariables();
    drupal_get_schema(NULL, TRUE);

    $form = array();
    $this->drupalPost(NULL, $form, 'Save field settings');

    return $name;
  }

  /**
   * @
   */
  public function testCreateLocation() {
    // @todo fixme
    return TRUE;
  }

  public function testLocpickOnly() {
    // @todo fixme
    return TRUE;
  }

  public function testMultipleLocationOnSingleNode() {
    // @todo fixme
    return TRUE;
  }

  public function testSharedLocation() {
    // @todo fixme
    return TRUE;
  }

  public function testNodeRevisionCOW() {
    // @todo fixme
    return TRUE;
  }

  public function testNodeRevisionCleanup() {
    // @todo fixme
    return TRUE;
  }

  public function testCOWConservation() {
    // @todo fixme
    return TRUE;
  }

}