Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gmap
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
gmap
Commits
3114de69
Commit
3114de69
authored
12 years ago
by
http://druler.com
Browse files
Options
Downloads
Patches
Plain Diff
Issue #1934122 by johnv | podarok: Views exports for tests. Initial test and hide a test module
parent
c2b380b0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/gmap.test
+85
-0
85 additions, 0 deletions
tests/gmap.test
tests/gmap_test/gmap_test.info
+1
-0
1 addition, 0 deletions
tests/gmap_test/gmap_test.info
with
86 additions
and
0 deletions
tests/gmap.test
+
85
−
0
View file @
3114de69
...
@@ -344,3 +344,88 @@ class LGFATestCase extends DrupalWebTestCase {
...
@@ -344,3 +344,88 @@ class LGFATestCase extends DrupalWebTestCase {
$this
->
assertText
(
t
(
'Find Address on Map'
));
$this
->
assertText
(
t
(
'Find Address on Map'
));
}
}
}
}
/**
* WebTest tests for location_gmap_find_address.module.
*/
class
GmapViewsTestCase
extends
DrupalWebTestCase
{
protected
$privileged_user
;
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'GmapViewsTestCase'
,
'description'
=>
'Test the Gmap Views.'
,
'group'
=>
'GMap'
,
);
}
public
function
setUp
()
{
parent
::
setUp
(
'location'
,
'gmap'
,
'location_cck'
,
'field_ui'
,
'location_gmap_find_address'
,
'gmap_test'
);
}
//@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
);
}
return
parent
::
error
(
$message
,
$group
,
$caller
);
}
public
function
testGmapSaveConfig
()
{
// login with user
$this
->
privileged_user
=
$this
->
drupalCreateUser
(
array
(
'administer site configuration'
,
'administer content types'
,
'bypass node access'
,
));
$this
->
drupalLogin
(
$this
->
privileged_user
);
// array for form
$edit
=
array
(
'location_usegmap'
=>
1
,
'location_default_country'
=>
'ua'
,
);
// change location default option
$this
->
drupalPost
(
'admin/config/content/location'
,
$edit
,
t
(
'Save configuration'
));
$this
->
assertText
(
t
(
'The configuration options have been saved.'
));
// change gmap API key
// array for form
$edit2
=
array
(
'gmap_api_key'
=>
'AIzaSyAe2PAkh_qvTq-3WkXQrVwVwh3Lo9FDvkk'
,
);
$this
->
drupalPost
(
'admin/config/services/gmap'
,
$edit2
,
t
(
'Save configuration'
));
$this
->
assertText
(
t
(
'The configuration options have been saved.'
));
// add location field to Basic page type
$edit3
=
array
(
'fields[_add_new_field][label]'
=>
'Location'
,
'fields[_add_new_field][field_name]'
=>
'location'
,
'fields[_add_new_field][type]'
=>
'location'
,
'fields[_add_new_field][widget_type]'
=>
'location'
,
);
$this
->
drupalPost
(
'admin/structure/types/manage/page/fields'
,
$edit3
,
t
(
'Save'
));
$this
->
assertText
(
t
(
'These settings apply to the Location field everywhere it is used. These settings impact the way that data is stored in the database and cannot be changed once data has been created.'
));
// admin/structure/types/manage/page/fields/field_location
$edit4
=
array
(
'field_location[und][0][country]'
=>
'ua'
,
'field[settings][gmap_marker]'
=>
'small red'
,
);
$this
->
drupalPost
(
'admin/structure/types/manage/page/fields/field_location'
,
$edit4
,
t
(
'Save settings'
));
$this
->
assertText
(
t
(
'Saved Location configuration.'
));
// check $form["#after_build"][] = "location_gmap_find_address_after_build";
$this
->
drupalGet
(
'node/add/page'
);
$this
->
assertText
(
t
(
'Find Address on Map'
));
}
}
This diff is collapsed.
Click to expand it.
tests/gmap_test/gmap_test.info
+
1
−
0
View file @
3114de69
...
@@ -4,6 +4,7 @@ core = 7.x
...
@@ -4,6 +4,7 @@ core = 7.x
package = Features
package = Features
version = 7.x-1.0-20130309
version = 7.x-1.0-20130309
project = gmap_test
project = gmap_test
hidden = TRUE
dependencies[] = addressfield
dependencies[] = addressfield
dependencies[] = ctools
dependencies[] = ctools
dependencies[] = entityreference
dependencies[] = entityreference
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment