public function GmapMacroToolboxTestCase::testGmapMacroToolbox in GMap Module 7.2
File
- tests/
oopmigration.test, line 152 - unit tests for refactoring steps
Class
Code
public function testGmapMacroToolbox() {
include_once drupal_get_path('module', 'gmap') . '/tests/inc/gmap_parse_macro.inc';
include_once drupal_get_path('module', 'gmap') . '/gmap_parse_macro.inc';
include_once drupal_get_path('module', 'gmap') . '/lib/Drupal/gmap/GmapMacroToolbox.php';
// legacy__gmap_parse_style($style)
$style = '#111111/1/100/#111111/1';
$check = \tests\inc\legacy__gmap_parse_style($style);
$result = GmapMacroToolbox::getInstance()
->setStyle($style)
->getParsedStyles();
$this
->assertEqual($check, $result);
$check = \tests\inc\legacy__gmap_parse_style($style);
$result = _gmap_parse_style($style);
$this
->assertEqual($check, $result);
// legacy__gmap_str2coord($str)
$coordString = '1.11111 , 2.11111 + 3.11111, 4.11111';
$check = \tests\inc\legacy__gmap_str2coord($coordString);
$result = GmapMacroToolbox::getInstance()
->setCoordString($coordString)
->getCoord();
$this
->assertEqual($check, $result);
$check = \tests\inc\legacy__gmap_str2coord($coordString);
$result = _gmap_str2coord($coordString);
$this
->assertEqual($check, $result);
// legacy__gmap_parse_macro($instring, $ver = 2)
$instring = '[gmap zoom=16 |center=50.450100000000006,30.523400000000045 |width=300px |height=200px |id=ght |control=Small |type=Map]';
$check = \tests\inc\legacy__gmap_parse_macro($instring, 2);
$result = GmapMacroToolbox::getInstance()
->setMacroString($instring, 2)
->getParsedMacro();
$this
->assertEqual($check, $result);
$check = \tests\inc\legacy__gmap_parse_macro($instring, 2);
$result = _gmap_parse_macro($instring, 2);
$this
->assertEqual($check, $result);
}