[pLog-svn] r6829 - plog/branches/lifetype-1.2/class/test/tests/dao

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Sat Feb 21 17:15:11 EST 2009


Author: jondaley
Date: 2009-02-21 17:15:11 -0500 (Sat, 21 Feb 2009)
New Revision: 6829

Modified:
   plog/branches/lifetype-1.2/class/test/tests/dao/commentscommon_test.class.php
Log:
since rev 6813, we actually check whether the category is valid or not, so we need a real category.  Without rev. 6828, this test would give a strange failure message, where it said the comment was added successfully, but then the count failed, when actually it was the addition of the comment that failed

Modified: plog/branches/lifetype-1.2/class/test/tests/dao/commentscommon_test.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/tests/dao/commentscommon_test.class.php	2009-02-21 22:08:22 UTC (rev 6828)
+++ plog/branches/lifetype-1.2/class/test/tests/dao/commentscommon_test.class.php	2009-02-21 22:15:11 UTC (rev 6829)
@@ -38,12 +38,18 @@
 			$blog = new BlogInfo( $randomName, $user->getId(), "About blog random blog", new BlogSettings());
 			$this->assertTrue($blogs->addBlog( $blog ), "Couldn't add test blog");
 
+            // create a category
+            $categories = new ArticleCategories();
+            $randomName = md5(time());
+            $category = new ArticleCategory($randomName, "blah", $blog->getId(), 1);
+            $this->assertTrue($categories->addArticleCategory($category), "Couldn't add test category");
+            
             // add an article
             $articles = new Articles();
 			$article = new Article(
 				"dummy topic",
 				"dummy text",
-				Array( 1 ),   // a dummy category (I don't need a category here)
+                $category->getId(), // our category we created above
 				$user->getId(), // our user we created above
 				$blog->getId(),  // our blog we created above
 				POST_STATUS_PUBLISHED,  // published status
@@ -136,7 +142,7 @@
             $this->assertTrue($comments->addComment($trackback2), "Couldn't add test trackback 2");
             $this->assertTrue($comments->addComment($trackback3), "Couldn't add test trackback 3");
             $this->assertTrue($comments->addComment($trackback4), "Couldn't add test trackback 4");
-
+            
             $num = $comments->getNumPostComments($article->getId(), COMMENT_STATUS_ALL, COMMENT_TYPE_ANY);
             $this->assertTrue($num == 7, "Wrong number of comments/trackbacks (all) ". $num);
             $num = $comments->getNumPostComments($article->getId(), COMMENT_STATUS_NONSPAM, COMMENT_TYPE_ANY);



More information about the pLog-svn mailing list