@@ 368-380 (lines=13) @@ | ||
365 | $this->assertEquals($expected, $location); |
|
366 | } |
|
367 | ||
368 | public function testAddMarkerByAddress() |
|
369 | { |
|
370 | //$address, $content = '', $category = '', $icon = '' |
|
371 | $map = $this->getMap(); |
|
372 | $map->addMarkerByAddress( |
|
373 | 'Koh Kred, Nonthaburi, Thailand', |
|
374 | 'Small island in the Chao Phraya river', |
|
375 | 'testing', |
|
376 | 'http://www.test.com/icon.png' |
|
377 | ); |
|
378 | $html = $map->forTemplate(); |
|
379 | $expected = 'data-mapmarkers=\'[{"latitude":13.9114455,"longitude":100.4761897,"html":"Small island in the Chao Phraya river","category":"testing","icon":"http://www.test.com/icon.png"}]\''; |
|
380 | $this->assertContains($expected, $html); |
|
381 | } |
|
382 | ||
383 | public function testAddArrayMarkerByCoords() |
|
@@ 400-414 (lines=15) @@ | ||
397 | $this->assertContains($expected, $html); |
|
398 | } |
|
399 | ||
400 | public function testAddMarkerByCoords() |
|
401 | { |
|
402 | $map = $this->getMap(); |
|
403 | $map->addMarkerByCoords( |
|
404 | 13.91, |
|
405 | 100.47, |
|
406 | 'Description of marker', |
|
407 | 'testing', |
|
408 | 'http://www.test.com/icon.png' |
|
409 | ); |
|
410 | $html = $map->forTemplate(); |
|
411 | $expected = |
|
412 | 'data-mapmarkers=\'[{"latitude":13.91,"longitude":100.47,"html":"Description of marker","category":"testing","icon":"http://www.test.com/icon.png"}]'; |
|
413 | ||
414 | $this->assertContains($expected, $html); |
|
415 | } |
|
416 | ||
417 | public function testAddMarkerAsObject() |