[Mapbender-commits] r6772 - trunk/mapbender/test/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Aug 19 12:08:07 EDT 2010


Author: christoph
Date: 2010-08-19 16:08:07 +0000 (Thu, 19 Aug 2010)
New Revision: 6772

Modified:
   trunk/mapbender/test/http/classes/GeoRssFactoryTest.php
   trunk/mapbender/test/http/classes/GeoRssTest.php
   trunk/mapbender/test/http/classes/RssTest.php
   trunk/mapbender/test/http/classes/UserTest.php
Log:
repaired tests

Modified: trunk/mapbender/test/http/classes/GeoRssFactoryTest.php
===================================================================
--- trunk/mapbender/test/http/classes/GeoRssFactoryTest.php	2010-08-19 16:06:41 UTC (rev 6771)
+++ trunk/mapbender/test/http/classes/GeoRssFactoryTest.php	2010-08-19 16:08:07 UTC (rev 6772)
@@ -6,11 +6,12 @@
 {
 	var $someRssFactory;
 	var $geoRss;
+	var $filename;
 	
 	public function setUp () {
 		$this->someRssFactory = new UniversalRssFactory();		
-		$filename = "../../data/GeoRss_PortalU.xml";
-    	$this->geoRss = $this->someRssFactory->createFromUrl($filename);
+		$this->filename = dirname(__FILE__) . "/../../data/GeoRss_PortalU.xml";
+    	$this->geoRss = $this->someRssFactory->createFromUrl($this->filename);
 	}
 
 	public function tearDown () {

Modified: trunk/mapbender/test/http/classes/GeoRssTest.php
===================================================================
--- trunk/mapbender/test/http/classes/GeoRssTest.php	2010-08-19 16:06:41 UTC (rev 6771)
+++ trunk/mapbender/test/http/classes/GeoRssTest.php	2010-08-19 16:08:07 UTC (rev 6772)
@@ -6,12 +6,15 @@
 {
 
 	var $geoRss;
-	protected $randomRss=  "../../http/tmp/rss_RssTest.xml";
+	var $filename;
+	protected $randomRss;
 
 	public function setUp () {
+    	$this->randomRss = dirname(__FILE__) . "/../../data/randomRss.xml";
 		$this->geoRssFactory = new GeoRssFactory();
-		$filename = "../../data/GeoRss_PortalU.xml";
-    	$this->geoRss = $this->geoRssFactory->createFromUrl($filename);
+		$this->filename = dirname(__FILE__) . "/../../data/GeoRss_PortalU.xml";
+    	$this->geoRss = $this->geoRssFactory->createFromUrl($this->filename);
+
     }
 
 	public function tearDown () {
@@ -41,14 +44,17 @@
     }
     public function testBboxCorrect()
     {
-    	$box = $this->geoRss->getItem(2)->getBbox();
-		$boxString =
-			$box->min->x . " " . $box->min->y . " " .
-			$box->max->x . " " . $box->max->y;
-    	$this->assertEquals(
-        	"12.0016 54.0477 12.2862 54.2481",
-        	$boxString
-        );
+    	$geoRssFactory = new GeoRssFactory();
+		$geoRss = $geoRssFactory->createFromUrl($this->filename);
+	   	$item = $this->geoRss->getItem(2);
+		$this->assertType('GeoRssItem',$item);
+		$bbox = $item->getBbox();
+		$this->assertType('Mapbender_bbox',$bbox);
+		$this->assertEquals(12.0016, $bbox->min->x);
+		$this->assertEquals(54.0477, $bbox->min->y);
+		$this->assertEquals(12.2862, $bbox->max->x);
+		$this->assertEquals(54.2481, $bbox->max->y);
+
     }
 	public function testCreateGeoRssAt()
 	{
@@ -61,7 +67,7 @@
 	public function testCreateGeoRssFromUrl()
 	{
 		$someGeoRssFactory = new GeoRssFactory();
-		$yetAnotherGeoRss = $someGeoRssFactory->createFromUrl($this->randomRss);
+		$yetAnotherGeoRss = $someGeoRssFactory->createFromUrl($this->filename);
 		$this->assertEquals(
         	"GeoRss",
         	get_class($yetAnotherGeoRss)
@@ -69,6 +75,8 @@
 	}
 	public function testAppendItemToGeoRss()
 	{
+		$anotherRssFactory = new GeoRssFactory();
+		$anotherGeoRss = $anotherRssFactory->createAt($this->randomRss);
 		$someGeoRssFactory = new GeoRssFactory();
 		$yetAnotherGeoRss = $someGeoRssFactory->createFromUrl($this->randomRss);
 		$yetAnotherGeoRss->setTitle("testTitel");

Modified: trunk/mapbender/test/http/classes/RssTest.php
===================================================================
--- trunk/mapbender/test/http/classes/RssTest.php	2010-08-19 16:06:41 UTC (rev 6771)
+++ trunk/mapbender/test/http/classes/RssTest.php	2010-08-19 16:08:07 UTC (rev 6772)
@@ -7,8 +7,11 @@
 	var $rss;
 
 	protected $someRssFactory;
-	protected $randomRss=  "../../http/tmp/rss_RssTest.xml";
+	protected $randomRss;
 
+	public function setUp () {
+    	$this->randomRss = dirname(__FILE__) . "/../../data/randomRss.xml";
+	}
 
 	public function testCreateRssAt()
     {

Modified: trunk/mapbender/test/http/classes/UserTest.php
===================================================================
--- trunk/mapbender/test/http/classes/UserTest.php	2010-08-19 16:06:41 UTC (rev 6771)
+++ trunk/mapbender/test/http/classes/UserTest.php	2010-08-19 16:08:07 UTC (rev 6772)
@@ -1,6 +1,6 @@
 <?php
 require_once 'PHPUnit/Framework.php';
-require_once '../../../http/classes/class_user.php';
+require_once dirname(__FILE__) . '/../../../http/classes/class_user.php';
 
 class UserTest extends PHPUnit_Framework_TestCase
 {



More information about the Mapbender_commits mailing list