You are here

public function GMapMacroTest::testEmptyMacro in GMap Module 7

Same name and namespace in other branches
  1. 6 tests/gmap.test \GMapMacroTest::testEmptyMacro()
  2. 7.2 tests/gmap.test \GMapMacroTest::testEmptyMacro()

File

tests/gmap.test, line 64
Unit tests for gmap.module.

Class

GMapMacroTest

Code

public function testEmptyMacro() {
  $macro = '';
  $map = gmap_parse_macro($macro);
  $this
    ->assertEqual(preg_match('/^auto\\d+map$/', $map['id']), 1, t('Testing ID injection'));
  $this
    ->assertEqual(count($map), 1, t('Testing contents of map array.'));
  $macro = '[gmap]';
  $map = gmap_parse_macro($macro);
  $this
    ->assertEqual(preg_match('/^auto\\d+map$/', $map['id']), 1, t('Testing ID injection'));
  $this
    ->assertEqual(count($map), 1, t('Testing contents of map array.'));
  $macro = '[gmap ]';
  $map = gmap_parse_macro($macro);
  $this
    ->assertEqual(preg_match('/^auto\\d+map$/', $map['id']), 1, t('Testing ID injection'));
  $this
    ->assertEqual(count($map), 1, t('Testing contents of map array.'));
}