[Mapbender-commits] r7007 - in branches/mapbender: lib test/data
test/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Sun Oct 3 14:19:20 EDT 2010
Author: christoph
Date: 2010-10-03 18:19:20 +0000 (Sun, 03 Oct 2010)
New Revision: 7007
Modified:
branches/mapbender/lib/class_Mapbender.php
branches/mapbender/test/data/userXml.xml
branches/mapbender/test/http/classes/UserTest.php
Log:
started implementing userTest (tests pass, but of no value yet). Have to find out how to compare expected and actual objects.
Modified: branches/mapbender/lib/class_Mapbender.php
===================================================================
--- branches/mapbender/lib/class_Mapbender.php 2010-10-02 19:35:14 UTC (rev 7006)
+++ branches/mapbender/lib/class_Mapbender.php 2010-10-03 18:19:20 UTC (rev 7007)
@@ -21,6 +21,10 @@
return Mapbender_database::singleton()->db();
}
+ public static function dbObject() {
+ return Mapbender_database::singleton();
+ }
+
public static function postgisAvailable () {
$sql = "Select postgis_full_version()";
$res = db_query($sql);
Modified: branches/mapbender/test/data/userXml.xml
===================================================================
--- branches/mapbender/test/data/userXml.xml 2010-10-02 19:35:14 UTC (rev 7006)
+++ branches/mapbender/test/data/userXml.xml 2010-10-03 18:19:20 UTC (rev 7007)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dataset>
- <mb_user mb_user_id="1" mb_user_name="root" mb_user_password="63a9f0ea7bb98050796b649e85481845" />
+ <mb_user mb_user_id="1" mb_user_name="root" mb_user_password="63a9f0ea7bb98050796b649e85481845" mb_user_owner="1" mb_user_description="root" mb_user_login_count="0" mb_user_email="" mb_user_phone="" mb_user_department="" mb_user_resolution="72" mb_user_organisation_name="" mb_user_position_name="" mb_user_phone1="" mb_user_facsimile="" mb_user_delivery_point="" mb_user_city="" mb_user_postal_code="" mb_user_country="" mb_user_online_resource="" mb_user_realname="" mb_user_street="" mb_user_housenumber="" mb_user_reference="" mb_user_for_attention_of="" mb_user_valid_from="" mb_user_valid_to="" mb_user_password_ticket="" mb_user_digest="" mb_user_firstname="" mb_user_lastname="" mb_user_academictitle=""/>
</dataset>
Modified: branches/mapbender/test/http/classes/UserTest.php
===================================================================
--- branches/mapbender/test/http/classes/UserTest.php 2010-10-02 19:35:14 UTC (rev 7006)
+++ branches/mapbender/test/http/classes/UserTest.php 2010-10-03 18:19:20 UTC (rev 7007)
@@ -31,7 +31,19 @@
mb_user_city character varying(255),
mb_user_postal_code integer,
mb_user_country character varying(255),
- mb_user_online_resource character varying(255)
+ mb_user_online_resource character varying(255),
+ mb_user_realname character varying(100),
+ mb_user_street character varying(100),
+ mb_user_housenumber character varying(50),
+ mb_user_reference character varying(100),
+ mb_user_for_attention_of character varying(100),
+ mb_user_valid_from DATE,
+ mb_user_valid_to DATE,
+ mb_user_password_ticket character varying(100),
+ mb_user_digest TEXT,
+ mb_user_firstname character varying(255),
+ mb_user_lastname character varying(255),
+ mb_user_academictitle character varying(255)
);
DB;
$this->pdo->query($mbUserDefinition);
@@ -52,12 +64,12 @@
}
public function testCreate () {
-// Mapbender::db()->connect($this->pdo);
-// $id = 1;
-// $user = new User($id);
-// print_r($user);
+ Mapbender::dbObject()->connect($this->pdo);
+ $id = 1;
+ $user = new User($id);
+ print_r($user);
-// $userFromXml = $this->createFlatXMLDataset($this->userXml);
+ $userFromXml = $this->createFlatXMLDataset($this->userXml);
// $this->assertEquals($user, $userFromXml);
}
}
More information about the Mapbender_commits
mailing list