openlayers.test in Openlayers 6
Same filename and directory in other branches
Main OpenLayers Test file
This file contains the tests for the openlayers module. Please note that since this module depends heavily on Javascript, these tests are limited in ensuring that the OpenLayers module functions 100% correctly.
File
tests/openlayers.testView source
<?php
/**
* @file
* Main OpenLayers Test file
*
* This file contains the tests for the openlayers
* module. Please note that since this module
* depends heavily on Javascript, these tests are
* limited in ensuring that the OpenLayers module
* functions 100% correctly.
*
* @ingroup openlayers
*/
/**
* Test OpenLayers presets.
*/
class OpenLayersPresetsHook extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'OpenLayers Presets Hook',
'description' => 'Tests the OpenLayers Preset hook.',
'group' => 'OpenLayers',
);
}
function setUp() {
// Install modules
parent::setUp('openlayers', 'openlayers_presets_ui', 'openlayers_test');
}
/**
* Ensure that the preset shows up in the interface
*/
function testOpenLayersPresetsHook() {
$user = $this
->drupalCreateUser(array(
'administer openlayers',
));
$this
->drupalLogin($user);
// Go to preset page
$this
->drupalGet('admin/settings/openlayers/presets/list');
$this
->assertResponse(200, t('Assert that user can reach and access preset list.'));
// Ensure that the default test is listed
$this
->assertText(t('Default Map'), t('Assert that the default preset\'s title appears.'));
$this
->assertText(t('This is the default map preset that comes with the OpenLayers module.'), t('Assert that the default preset\'s description appears.'));
}
}
Classes
Name![]() |
Description |
---|---|
OpenLayersPresetsHook | Test OpenLayers presets. |