You are here

function OpenLayersPresetsHook::testOpenLayersPresetsHook in Openlayers 6

Ensure that the preset shows up in the interface

File

tests/openlayers.test, line 36
Main OpenLayers Test file

Class

OpenLayersPresetsHook
Test OpenLayers presets.

Code

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.'));
}