Skip to content
Snippets Groups Projects
Commit 348cab71 authored by http://druler.com's avatar http://druler.com
Browse files

Issue #1934122 by podarok, johnv: Views exports for tests.

parent b8ec7fef
No related branches found
Tags 6.x-2.0-beta1
No related merge requests found
......@@ -26,10 +26,6 @@ class GmapViewsTestCase extends DrupalWebTestCase {
// change error (Notice) to debug message
return $this->assert('debug', $message, 'Debug', $caller);
}
if ($message == 'Undefined index: geofield') {
// change error (Notice) to debug message
return $this->assert('debug', $message, 'Debug', $caller);
}
return parent::error($message, $group, $caller);
}
......
<?php
/**
* @file
* gmap_test_extended.features.field.inc
*/
/**
* Implements hook_field_default_fields().
*/
function gmap_test_extended_field_default_fields() {
$fields = array();
// Exported field: 'node-gmap_person-field_mylocation'.
$fields['node-gmap_person-field_mylocation'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_mylocation',
'foreign keys' => array(
'node' => array(
'columns' => array(
'target_id' => 'nid',
),
'table' => 'node',
),
),
'indexes' => array(
'target_id' => array(
0 => 'target_id',
),
),
'locked' => '0',
'module' => 'entityreference',
'settings' => array(
'handler' => 'base',
'handler_settings' => array(
'behaviors' => array(
'views-select-list' => array(
'status' => 0,
),
),
'sort' => array(
'type' => 'none',
),
'target_bundles' => array(
'gmapplace' => 'gmapplace',
),
),
'target_type' => 'node',
),
'translatable' => '0',
'type' => 'entityreference',
),
'field_instance' => array(
'bundle' => 'gmap_person',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'entityreference',
'settings' => array(
'link' => FALSE,
),
'type' => 'entityreference_label',
'weight' => 1,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_mylocation',
'label' => 'MyLocation',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'options',
'settings' => array(),
'type' => 'options_select',
'weight' => '-3',
),
),
);
// Exported field: 'node-gmapplace-body'.
$fields['node-gmapplace-body'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'deleted' => '0',
'entity_types' => array(
0 => 'node',
),
'field_name' => 'body',
'foreign keys' => array(
'format' => array(
'columns' => array(
'format' => 'format',
),
'table' => 'filter_format',
),
),
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => '0',
'module' => 'text',
'settings' => array(),
'translatable' => '0',
'type' => 'text_with_summary',
),
'field_instance' => array(
'bundle' => 'gmapplace',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => '0',
),
'teaser' => array(
'label' => 'hidden',
'module' => 'text',
'settings' => array(
'trim_length' => 600,
),
'type' => 'text_summary_or_trimmed',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'body',
'label' => 'Body',
'required' => FALSE,
'settings' => array(
'display_summary' => TRUE,
'text_processing' => 1,
'user_register_form' => FALSE,
),
'widget' => array(
'module' => 'text',
'settings' => array(
'rows' => 20,
'summary_rows' => 5,
),
'type' => 'text_textarea_with_summary',
'weight' => '1',
),
),
);
// Exported field: 'node-gmapplace-field_myaddress'.
$fields['node-gmapplace-field_myaddress'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '-1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_myaddress',
'foreign keys' => array(),
'indexes' => array(),
'locked' => '0',
'module' => 'addressfield',
'settings' => array(),
'translatable' => '0',
'type' => 'addressfield',
),
'field_instance' => array(
'bundle' => 'gmapplace',
'default_value' => array(
0 => array(
'element_key' => 'node|gmapplace|field_myaddress|und|0',
'thoroughfare' => '',
'premise' => '',
'postal_code' => '',
'locality' => '',
'country' => 'NL',
),
),
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'addressfield',
'settings' => array(
'format_handlers' => array(
0 => 'address',
),
'use_widget_handlers' => 1,
),
'type' => 'addressfield_default',
'weight' => '4',
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_myaddress',
'label' => 'MyAddress',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'addressfield',
'settings' => array(
'available_countries' => array(),
'format_handlers' => array(
'address' => 'address',
'address-hide-country' => 0,
'organisation' => 0,
'name-full' => 0,
'name-oneline' => 0,
),
),
'type' => 'addressfield_standard',
'weight' => '2',
),
),
);
// Exported field: 'node-gmapplace-field_mygeofield'.
$fields['node-gmapplace-field_mygeofield'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_mygeofield',
'foreign keys' => array(),
'indexes' => array(),
'locked' => '0',
'module' => 'geofield',
'settings' => array(),
'translatable' => '0',
'type' => 'geofield',
),
'field_instance' => array(
'bundle' => 'gmapplace',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'geofield',
'settings' => array(
'data' => 'full',
'format' => 'decimal_degrees',
'labels' => 1,
),
'type' => 'geofield_latlon',
'weight' => '1',
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_mygeofield',
'label' => 'mygeofield',
'required' => 0,
'settings' => array(
'local_solr' => array(
'enabled' => FALSE,
'lat_field' => 'lat',
'lng_field' => 'lng',
),
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'geofield',
'settings' => array(),
'type' => 'geofield_latlon',
'weight' => '3',
),
),
);
// Exported field: 'node-gmapplace-field_mylatitude'.
$fields['node-gmapplace-field_mylatitude'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_mylatitude',
'foreign keys' => array(
'format' => array(
'columns' => array(
'format' => 'format',
),
'table' => 'filter_format',
),
),
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => '0',
'module' => 'text',
'settings' => array(
'max_length' => '20',
),
'translatable' => '0',
'type' => 'text',
),
'field_instance' => array(
'bundle' => 'gmapplace',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => '2',
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_mylatitude',
'label' => 'mylatitude',
'required' => 0,
'settings' => array(
'text_processing' => '0',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'text',
'settings' => array(
'size' => '20',
),
'type' => 'text_textfield',
'weight' => '4',
),
),
);
// Exported field: 'node-gmapplace-field_mylongitude'.
$fields['node-gmapplace-field_mylongitude'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_mylongitude',
'foreign keys' => array(
'format' => array(
'columns' => array(
'format' => 'format',
),
'table' => 'filter_format',
),
),
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => '0',
'module' => 'text',
'settings' => array(
'max_length' => '20',
),
'translatable' => '0',
'type' => 'text',
),
'field_instance' => array(
'bundle' => 'gmapplace',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => '3',
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_mylongitude',
'label' => 'mylongitude',
'required' => 0,
'settings' => array(
'text_processing' => '0',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'text',
'settings' => array(
'size' => '20',
),
'type' => 'text_textfield',
'weight' => '5',
),
),
);
// Translatables
// Included for use with string extractors like potx.
t('Body');
t('MyAddress');
t('MyLocation');
t('mygeofield');
t('mylatitude');
t('mylongitude');
return $fields;
}
<?php
/**
* @file
* gmap_test_extended.features.inc
*/
/**
* Implements hook_views_api().
*/
function gmap_test_extended_views_api() {
return array("version" => "3.0");
}
/**
* Implements hook_node_info().
*/
function gmap_test_extended_node_info() {
$items = array(
'gmap_person' => array(
'name' => t('GMapPerson'),
'base' => 'node_content',
'description' => t('Defines a \'person\', which has a refernce to a GMapLocation.
Thi si sused to thest the Gmap via referenced entities'),
'has_title' => '1',
'title_label' => t('Person name'),
'help' => '',
),
'gmapplace' => array(
'name' => t('GmapPlace'),
'base' => 'node_content',
'description' => t('A node type that contains locations, in 3 different field types:
- location
- geofield
- normal fields'),
'has_title' => '1',
'title_label' => t('Title'),
'help' => '',
),
);
return $items;
}
name = GMap test extended
description = Some Content types and Views to test GMap Extended
core = 7.x
package = Features
version = 7.x-1.0-20130309
project = gmap_test_extended
hidden = TRUE
dependencies[] = addressfield
dependencies[] = ctools
dependencies[] = entityreference
dependencies[] = features
dependencies[] = field_sql_storage
dependencies[] = geofield
dependencies[] = geophp
dependencies[] = node
dependencies[] = options
dependencies[] = text
dependencies[] = views
dependencies[] = views_ui
dependencies[] = gmap
features[ctools][] = views:views_default:3.0
features[features_api][] = api:1
features[field][] = node-gmap_person-field_mylocation
features[field][] = node-gmapplace-body
features[field][] = node-gmapplace-field_myaddress
features[field][] = node-gmapplace-field_mygeofield
features[field][] = node-gmapplace-field_mylatitude
features[field][] = node-gmapplace-field_mylongitude
features[node][] = gmap_person
features[node][] = gmapplace
features[views_view][] = gmap_test_extended_places
files[] = gmap_test_extended.features.field.inc
files[] = gmap_test_extended.features.inc
files[] = gmap_test_extended.views_default.inc
files[] = tests/gmap_test_extended.test
<?php
/**
* @file
* Code for the GMap test feature.
*/
include_once 'gmap_test_extended.features.inc';
This diff is collapsed.
<?php
/**
* WebTest tests for gmap_test_extended.module.
*/
class GmapViewsExtendedTestCase extends DrupalWebTestCase {
protected $privileged_user;
protected $modules = array('gmap', 'gmap_test_extended', 'views', 'views_ui', 'text','options','geofield','features', 'entityreference', 'addressfield', 'location', 'location_cck', 'geophp', 'entity');
public static function getInfo() {
return array(
'name' => 'GmapViewsExtendedTestCase',
'description' => 'Test the Gmap Views Extended.',
'group' => 'GMap',
);
}
public function setUp() {
parent::setUp($this->modules);
}
//@todo remove this after http://drupal.org/node/1252310#comment-7109128 fix
protected function error($message = '', $group = 'Other', array $caller = NULL) {
if ($message == 'Undefined index: location_settings') {
// change error (Notice) to debug message
return $this->assert('debug', $message, 'Debug', $caller);
}
// @todo create follow-up
if ($message == 'Undefined index: iwq') {
// change error (Notice) to debug message
return $this->assert('debug', $message, 'Debug', $caller);
}
// @todo create follow-up
if ($message == 'Undefined index: highlight_nodearg_color') {
// change error (Notice) to debug message
return $this->assert('debug', $message, 'Debug', $caller);
}
// @todo create follow-up
if ($message == 'implode(): Invalid arguments passed') {
// change error (Notice) to debug message
return $this->assert('debug', $message, 'Debug', $caller);
}
return parent::error($message, $group, $caller);
}
public function testGmapViews() {
// login with user
$this->privileged_user = $this->drupalCreateUser(array_keys(module_invoke_all('permission')));
$this->drupalLogin($this->privileged_user);
// array for form
$edit = array();
// page view
$this->drupalPost('admin/structure/views/view/gmap_test_extended_places/edit/page', $edit, t('Save'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/page/style_plugin', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/page/style_options', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/page/relationship/field_mylocation_target_id', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/page/field/latitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/page/field/longitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/page/field/field_mygeofield', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/page/field/field_mylatitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/page/field/field_mylongitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/page/field/field_mygeofield_1', $edit, t('Apply'));
// table view
$this->drupalPost('admin/structure/views/view/gmap_test_extended_places/edit/block_table', $edit, t('Save'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_table/relationship/field_mylocation_target_id', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_table/field/latitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_table/field/longitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_table/field/field_mygeofield', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_table/field/field_mylatitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_table/field/field_mylongitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_table/field/field_mygeofield_1', $edit, t('Apply'));
// block_geofield view
$this->drupalPost('admin/structure/views/view/gmap_test_extended_places/edit/block_geofield', $edit, t('Save'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_geofield/style_plugin', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_geofield/style_options', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_geofield/relationship/field_mylocation_target_id', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_geofield/field/latitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_geofield/field/longitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_geofield/field/field_mygeofield', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_geofield/field/field_mylatitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_geofield/field/field_mylongitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_geofield/field/field_mygeofield_1', $edit, t('Apply'));
// block_location view
$this->drupalPost('admin/structure/views/view/gmap_test_extended_places/edit/block_location', $edit, t('Save'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_location/style_plugin', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_location/style_options', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_location/relationship/field_mylocation_target_id', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_location/field/latitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_location/field/longitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_location/field/field_mygeofield', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_location/field/field_mylatitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_location/field/field_mylongitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_location/field/field_mygeofield_1', $edit, t('Apply'));
// block_field view
$this->drupalPost('admin/structure/views/view/gmap_test_extended_places/edit/block_field', $edit, t('Save'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_field/style_plugin', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_field/style_options', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_field/relationship/field_mylocation_target_id', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_field/field/latitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_field/field/longitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_field/field/field_mygeofield', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_field/field/field_mylatitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_field/field/field_mylongitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_field/field/field_mygeofield_1', $edit, t('Apply'));
// block_2 view
$this->drupalPost('admin/structure/views/view/gmap_test_extended_places/edit/block_2', $edit, t('Save'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_2/style_plugin', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_2/style_options', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_2/relationship/field_mylocation_target_id', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_2/field/latitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_2/field/longitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_2/field/field_mygeofield', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_2/field/field_mylatitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_2/field/field_mylongitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_2/field/field_mygeofield_1', $edit, t('Apply'));
// block_3 view
$this->drupalPost('admin/structure/views/view/gmap_test_extended_places/edit/block_3', $edit, t('Save'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_3/style_plugin', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/display/gmap_test_extended_places/block_3/style_options', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_3/relationship/field_mylocation_target_id', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_3/field/latitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_3/field/longitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_3/field/field_mygeofield', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_3/field/field_mylatitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_3/field/field_mylongitude', $edit, t('Apply'));
$this->drupalPost('admin/structure/views/nojs/config-item/gmap_test_extended_places/block_3/field/field_mygeofield_1', $edit, t('Apply'));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment