[Mapbender-commits] r4741 - trunk/mapbender/test/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Sat Sep 26 15:14:05 EDT 2009
Author: verenadiewald
Date: 2009-09-26 15:14:05 -0400 (Sat, 26 Sep 2009)
New Revision: 4741
Modified:
trunk/mapbender/test/http/classes/GeoRssTest.php
Log:
Modified: trunk/mapbender/test/http/classes/GeoRssTest.php
===================================================================
--- trunk/mapbender/test/http/classes/GeoRssTest.php 2009-09-26 19:00:41 UTC (rev 4740)
+++ trunk/mapbender/test/http/classes/GeoRssTest.php 2009-09-26 19:14:05 UTC (rev 4741)
@@ -1,20 +1,18 @@
<?php
require_once 'PHPUnit/Framework.php';
-require_once dirname(__FILE__) . "/../../../http/classes/class_universal_rss_factory.php";
require_once dirname(__FILE__) . "/../../../http/classes/class_georss_factory.php";
class GeoRssTest extends PHPUnit_Framework_TestCase
{
var $geoRss;
- var $randomRss;
+ protected $randomRss= "../../http/tmp/rss_RssTest.xml";
public function setUp () {
$this->geoRssFactory = new GeoRssFactory();
$filename = "../../data/GeoRss_PortalU.xml";
$this->geoRss = $this->geoRssFactory->createFromUrl($filename);
- $this->randomRss = str_replace(".xml", "_" . rand() . ".xml", "../../http/tmp/rss.xml");
- }
+ }
public function tearDown () {
unset($this->geoRssFactory);
@@ -52,40 +50,33 @@
$boxString
);
}
- public function testCreateRssAt()
- {
- $aSecondRssFactory = new RssFactory();
- $anotherRss = $aSecondRssFactory->createAt($this->randomRss);
+ public function testCreateGeoRssAt()
+ {
+ $anotherRssFactory = new GeoRssFactory();
+ $anotherGeoRss = $anotherRssFactory->createAt($this->randomRss);
$this->assertNotNull(
- $anotherRss
+ $anotherGeoRss
);
}
- public function testCreateRssFromUrl()
+ public function testCreateGeoRssFromUrl()
{
- $someRssFactory = new UniversalRssFactory();
- #echo $this->randomRss;
- $yetAnotherRss = $someRssFactory->createFromUrl($this->randomRss);
+ $someGeoRssFactory = new GeoRssFactory();
+ $yetAnotherGeoRss = $someGeoRssFactory->createFromUrl($this->randomRss);
$this->assertEquals(
- "Rss",
- get_class($yetAnotherRss)
+ "GeoRss",
+ get_class($yetAnotherGeoRss)
);
}
- public function testCreateGeoRssAt()
+ public function testAppendItemToGeoRss()
{
- $anotherRssFactory = new GeoRssFactory();
- $anotherGeoRss = $anotherRssFactory->createAt($this->randomRss);
- $this->assertNotNull(
- $anotherGeoRss
- );
+ $someGeoRssFactory = new GeoRssFactory();
+ $yetAnotherGeoRss = $someGeoRssFactory->createFromUrl($this->randomRss);
+ $yetAnotherGeoRss->setTitle("testTitel");
+ $yetAnotherGeoRss->setDescription("testDescription");
+ $yetAnotherGeoRss->setUrl("testUrl");
+ $item = $yetAnotherGeoRss->append();
+ $item->setBbox(new Mapbender_bbox(8,49,9,50,"EPSG:4326"));
+ $this->assertTrue($yetAnotherGeoRss->saveAsFile());
}
-// public function testCreateGeoRssFromUrl()
-// {
-// $someRssFactory = new UniversalRssFactory();
-// $yetAnotherGeoRss = $someRssFactory->createFromUrl($this->randomRss);
-// $this->assertEquals(
-// "GeoRss",
-// get_class($yetAnotherGeoRss)
-// );
-// }
}
?>
\ No newline at end of file
More information about the Mapbender_commits
mailing list