[pLog-svn] r5133 - in plog/branches/lifetype-1.2/class: dao net/xmlrpc test/tests/net/xmlrpc

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Mon Mar 19 14:28:02 EDT 2007


Author: pwestbro
Date: 2007-03-19 14:28:02 -0400 (Mon, 19 Mar 2007)
New Revision: 5133

Modified:
   plog/branches/lifetype-1.2/class/dao/blogs.class.php
   plog/branches/lifetype-1.2/class/net/xmlrpc/xmlrpcserver.class.php
   plog/branches/lifetype-1.2/class/test/tests/net/xmlrpc/xmlrpcserver_test.class.php
Log:
Fixed bug 1219

Now posting works from within digg, when using the MetaWeblog API

Added missing include in blogs.class.php

Reenabled the xmlrpcserver test cases


Modified: plog/branches/lifetype-1.2/class/dao/blogs.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/blogs.class.php	2007-03-19 09:15:36 UTC (rev 5132)
+++ plog/branches/lifetype-1.2/class/dao/blogs.class.php	2007-03-19 18:28:02 UTC (rev 5133)
@@ -314,6 +314,9 @@
 			// update blog categories
 			$blog = $this->getBlogInfo( $blogId );
 			$this->updateBlogCategoriesLink( $blog );	
+
+            // source class
+            lt_include( PLOG_CLASS_PATH."class/template/templatesets/templatesets.class.php" );
 	
 			// delete the blog template sets
 			$templateSets = new TemplateSets();

Modified: plog/branches/lifetype-1.2/class/net/xmlrpc/xmlrpcserver.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/net/xmlrpc/xmlrpcserver.class.php	2007-03-19 09:15:36 UTC (rev 5132)
+++ plog/branches/lifetype-1.2/class/net/xmlrpc/xmlrpcserver.class.php	2007-03-19 18:28:02 UTC (rev 5133)
@@ -41,6 +41,7 @@
 			            "metaWeblog.getRecentPosts" => "this:metaWeblogGetRecentPosts",
 			            "metaWeblog.getCategories"  => "this:metaWeblogGetCategories",
 			            "metaWeblog.newMediaObject" => "this:metaWeblogNewMediaObject",	
+			            "metaWeblog.getUsersBlogs"  => "this:getUsersBlogs",
 			            "mt.getCategoryList"        => "this:mtGetCategoryList",
 			            "mt.supportedTextFilters"   => "this:mtSupportedTextFilters", 
 			            "mt.getPostCategories"      => "this:mtGetPostCategories",

Modified: plog/branches/lifetype-1.2/class/test/tests/net/xmlrpc/xmlrpcserver_test.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/tests/net/xmlrpc/xmlrpcserver_test.class.php	2007-03-19 09:15:36 UTC (rev 5132)
+++ plog/branches/lifetype-1.2/class/test/tests/net/xmlrpc/xmlrpcserver_test.class.php	2007-03-19 18:28:02 UTC (rev 5133)
@@ -101,7 +101,7 @@
 		/**
 		 * test the blogger.newPost method call
 		 */
-		function _testBloggerNewPost()
+		function testBloggerNewPost()
 		{
 			$c = new IXR_Client( $this->url );
 			$res = $c->query( "blogger.newPost", 
@@ -201,7 +201,7 @@
 		/**
 		 * test the blogger.getUserInfo method cal
 		 */
-		function _testBloggerGetUserInfo()
+		function testBloggerGetUserInfo()
 		{
 			$c = new IXR_Client( $this->url );
 			$res = $c->query( "blogger.getUserInfo", 
@@ -228,7 +228,7 @@
 		/**
 		 * test the blogger.getUserInfo method call
 		 */
-		function _testBloggerGetUsersBlogs()
+		function testBloggerGetUsersBlogs()
 		{
 			$c = new IXR_Client( $this->url );
 			$res = $c->query( "blogger.getUsersBlogs", 
@@ -253,9 +253,36 @@
 		}		
 		
 		/**
+		 * test the metaWeblog.getUsersBlogs method call
+		 */
+		function testMetaweblogGetUsersBlogs()
+		{
+			$c = new IXR_Client( $this->url );
+			$res = $c->query( "metaWeblog.getUsersBlogs", 
+			           "appkey", 
+					   $this->owner->getUsername(), 
+					   "password" );
+					
+			// see that the call was successful
+			$this->assertTrue( $res, "Unable to query ".$this->url." with method blogger.getUsersBlogs" );
+			
+			// and check the data in the response
+			$blogs = $c->getResponse();
+			// there should be only one blog			
+			$this->assertEquals( $this->blog->getId(), $blogs[0]["blogid"] );
+			$this->assertEquals( $this->blog->getBlog(), $blogs[0]["blogName"] );
+			$url = $this->blog->getBlogRequestGenerator();
+			$this->assertEquals( $url->blogLink(), $blogs[0]["url"] );			
+
+			// get the response and see that it has the right encoding
+			$this->assertTrue( $this->checkResponseEncoding( $c->message->rawmessage, $this->blog ), 
+			                   "The blog encoding and the response of the XMLRPC request did not match!" );			
+		}		
+		
+		/**
 		 * test the blogger.editPost method call
 		 */
-		function _testBloggerEditPost()
+		function testBloggerEditPost()
 		{
 			// create a new post first
 			$article = new Article(
@@ -333,7 +360,7 @@
 		/**
 		 * Test case the blogger.deletePost method call
 		 */
-		function _testBloggerDeletePost()
+		function testBloggerDeletePost()
 		{
 			// create a new post first
 			$article = new Article(
@@ -378,7 +405,7 @@
 		/**
 		 * test case for blogger.getRecentPosts
 		 */
-		function _testBloggerGetRecentPosts()
+		function testBloggerGetRecentPosts()
 		{
 			// create a new post first
 			$article = new Article(
@@ -433,7 +460,7 @@
 		/**
 		 * test case for blogger.getPost
 		 */
-		function _testBloggerGetPost()
+		function testBloggerGetPost()
 		{
 			// create a new post first
 			$article = new Article(
@@ -650,7 +677,7 @@
 		/** 
 		 * test case for the metaWeblog.getPost method call
 		 */
-		function _testMetaWeblogGetPost()
+		function testMetaWeblogGetPost()
 		{
 			// create a new post first
 			$article = new Article(
@@ -727,7 +754,7 @@
 			// and now compare that the returned values match with what we expected
 			$this->assertEquals( $this->owner->getId(), $response["userid"], "The user id of the article does not match" );
 			$this->assertEquals( "topic", $response["title"], "The topic of the post does not match" );
-			$this->assertEquals( "Intro text" . POST_EXTENDED_TEXT_MODIFIER . "Extended text", $response["description"], "The text of the article does not match" );
+			$this->assertEquals( "Intro text", $response["description"], "The text of the article does not match" );
 			$this->assertEquals( $article->getId(), $response["postid"] );
 			$url = $this->blog->getBlogRequestGenerator();
 			$this->assertEquals( $url->postLink( $article ), $response["link"], "The post permalink does not match" );
@@ -807,7 +834,7 @@
 		/** 
 		 * Test the metaWeblog.getCategories
 		 */
-		function _testMetaWeblogGetCategories()
+		function testMetaWeblogGetCategories()
 		{
 			// make the method call
 			$c = new IXR_Client( $this->url );
@@ -838,7 +865,7 @@
 			                   "The blog encoding and the response of the XMLRPC request did not match!" );			
 		}
 		
-		function _testMTGetCategoryList()
+		function testMTGetCategoryList()
 		{
 			// make the method call
 			$c = new IXR_Client( $this->url );
@@ -866,7 +893,7 @@
 			                   "The blog encoding and the response of the XMLRPC request did not match!" );			
 		}
 		
-		function _testMetaWeblogGetRecentPosts()
+		function testMetaWeblogGetRecentPosts()
 		{
 			// create a new post first
 			$article = new Article(
@@ -919,7 +946,7 @@
 		}
 		
 		
-        function _testMTSupportedTextFilters()
+        function testMTSupportedTextFilters()
 		{
 			// make the method call
 			$c = new IXR_Client( $this->url );
@@ -935,7 +962,7 @@
 									
 		}
 		
-		function _testMTGetPostCategories()
+		function testMTGetPostCategories()
 		{
 			// create a new post first
 			$article = new Article(
@@ -981,7 +1008,7 @@
 		}
 
 		
-		function _testMTSetPostCategories()
+		function testMTSetPostCategories()
 		{
 			// create a new post first, with no category
 			$article = new Article(



More information about the pLog-svn mailing list