<?php require_once ('lib/simpletest/unit_tester.php'); require_once ('html/HtmlMap.inc') ;
class HtmlMapTests extends UnitTestCase {
public function testSimpleMap () {
$d = new HtmlDocument ('test') ; $m = new HtmlMap ($d, 4, 51, 5, 400, 400) ; $d->setBody ($m) ;
$s = $d->build() ;
$this->assertPattern ('/maps.google.com/', $s) ; $this->assertPattern ('/GUnload()/', $s) ; $this->assertNoPattern ('/GBrowserIsCompatible()/', $s) ;
echo ($s) ; }
public function testMarkedMap () {
$d = new HtmlDocument ('test') ; $m = new HtmlMap ($d, 4, 51, 5, 400, 400) ; $m->setNonCompatible (new HtmlBlock ("oops, maps don't work!")) ; $m->addMarker (5, 52, "test1") ; $m->addMarker (5, 50, "test2") ; $m->addMarker (3, 52, "test3") ; $m->addMarker (3, 50, "test4") ;
$d->setBody ($m) ;
$s = $d->build() ;
$this->assertPattern ('/maps.google.com/', $s) ; $this->assertPattern ('/GUnload()/', $s) ; $this->assertPattern ('/52,5/', $s) ; $this->assertPattern ('/50,5/', $s) ; $this->assertPattern ('/52,3/', $s) ; $this->assertPattern ('/50,3/', $s) ; $this->assertPattern ("/oops, maps don't work!/", $s) ;
echo ($s) ; }
} ;
?>
|