[pLog-svn] r6666 - plog/branches/lifetype-1.2/class/test/helpers

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Mon Jun 23 16:46:03 EDT 2008


Author: jondaley
Date: 2008-06-23 16:46:03 -0400 (Mon, 23 Jun 2008)
New Revision: 6666

Modified:
   plog/branches/lifetype-1.2/class/test/helpers/testtools.class.php
Log:
blogs need a default category, otherwise the 'newpost' page, which we use to detect whether we logged in correctly or not, won't work

Modified: plog/branches/lifetype-1.2/class/test/helpers/testtools.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/helpers/testtools.class.php	2008-06-23 20:33:19 UTC (rev 6665)
+++ plog/branches/lifetype-1.2/class/test/helpers/testtools.class.php	2008-06-23 20:46:03 UTC (rev 6666)
@@ -34,10 +34,22 @@
 			);
 			
 			$blogs = new Blogs();
-			if( $blogs->addBlog( $blog ))
-				return $blog;
-			else
-				return false;
+			if(!$blogs->addBlog($blog))
+                return false;
+
+                // every blog needs an article category, otherwise,
+                // other things don't work (like posting, which is our check
+                // to see if we successfully logged in)
+
+            // add a default category
+            $articleCategories = new ArticleCategories();
+            $articleCategory = new ArticleCategory( "Default Category", "", $blog->getId(), true );
+            $catId = $articleCategories->addArticleCategory( $articleCategory );
+
+            if(!$catId)
+                print "Couldn't create default category for blog";
+
+            return $blog;
 		}
 		
 		/**



More information about the pLog-svn mailing list