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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Sep 26 07:24:06 EDT 2009


Author: astrid_emde
Date: 2009-09-26 07:24:03 -0400 (Sat, 26 Sep 2009)
New Revision: 4702

Modified:
   trunk/mapbender/test/http/classes/GroupTest.php
Log:
test

Modified: trunk/mapbender/test/http/classes/GroupTest.php
===================================================================
--- trunk/mapbender/test/http/classes/GroupTest.php	2009-09-26 10:54:18 UTC (rev 4701)
+++ trunk/mapbender/test/http/classes/GroupTest.php	2009-09-26 11:24:03 UTC (rev 4702)
@@ -5,48 +5,51 @@
 class GroupTest extends PHPUnit_Framework_TestCase
 {
 	var $someGroup;
+    var $someGroup_name = "demo";
+    var $someGroup_description = "Demo Group zum Test";
 	
-	public function setUp () {
-		$this->someGroup = new Group();		
-
-	}
-
-	public function tearDown () {
-		unset($this->someRssFactory);	
-	}
-	
-	
 	public function testCreate()
     {
-        $this->assertEquals("GeoRss", get_class($this->geoRss));
+      $group = new Group(null);
+      $group->name = $someGroup_name;
+      $group->description = $someGroup_description;
+
+      $create_message="Group creation failed";
+      try{
+        $create_result = $group->create();
+      }
+      catch(Exception $E)
+      {
+        $this->assertEquals($E->getMessage(), 'Could not set initial values of new Group');
+      }
+      $this->assertTrue($create_result,$create_message);
+      
+      $change_result = $group->change(array());
+      $this->assertTrue($change_result);
+      
+      try{
+        $commit_result =  $group->commit();
+      }
+      catch(Exception $E)
+      {
+        $this->assertEquals($E->getMessage(), 'Database error updating Group');
+      }
+      
+      $this->assertTrue($commit_result);
     }
 	
-	public function testChange()
-    {
-        $this->assertEquals("GeoRss", get_class($this->geoRss));
-    }
     
-	public function testLoad()
-    {
-
-    }
-    
     public function testRemove()
     {
+      $group = Group::byName($someGroup_name);
+      $this->assertNotNull($group);
 
-    }
-    
-    public function testByName()
-    {
+      $group->remove();
 
-    }
-    
-	public function testGetList()
-    {
+      $group = null;
+      $group = Group::byName($someGroup_name);
+      $this->assertNull($group);
+    } 
 
-    }
-    
-    
-
 }
 ?>
\ No newline at end of file



More information about the Mapbender_commits mailing list