You are here

function OpenLayersFilters::testOpenLayersMapAlters in Openlayers 6.2

File

modules/openlayers_filters/tests/openlayers_filters.test, line 27
OpenLayers Filters tests.

Class

OpenLayersFilters
Test Case for OpenLayers filters

Code

function testOpenLayersMapAlters() {
  $user = $this
    ->drupalCreateUser(array(
    'administer filters',
    'access content',
    'administer nodes',
  ));
  $this
    ->drupalLogin($user);

  // Variables
  $format_name = 'openlayers_filter_test_format';

  // Create new input format
  $format = array();
  $format['name'] = $format_name;
  $format['roles[2]'] = 'checked';
  $format['filters[openlayers_filters/0]'] = TRUE;
  $this
    ->drupalPost('admin/settings/filters/add', $format, 'Save configuration');
  $this
    ->drupalGet('admin/settings/filters');
  $this
    ->assertText($format_name, t('Filter created and in list'));

  // Create new story with macro
  $story = array();
  $story['title'] = 'filter_testing';
  $story['body'] = 'Testing content and inline map: [openlayers default]';

  // This should actually get the ID correctly
  $story['format'] = 3;
  $this
    ->drupalPost('node/add/story', $story, 'Save');
  $node = $this
    ->drupalGetNodeByTitle($story["title"]);
  $this
    ->drupalGet('node/' . $node->nid);
  $this
    ->assertRaw('class="openlayers-container openlayers-container-preset-', t('Found OpenLayers output.'));
}