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

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Mon Jun 23 17:59:07 EDT 2008


Author: jondaley
Date: 2008-06-23 17:59:07 -0400 (Mon, 23 Jun 2008)
New Revision: 6672

Modified:
   plog/branches/lifetype-1.2/class/test/tests/dao/articlecategories_test.class.php
Log:
better cleanup

Modified: plog/branches/lifetype-1.2/class/test/tests/dao/articlecategories_test.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/tests/dao/articlecategories_test.class.php	2008-06-23 21:58:22 UTC (rev 6671)
+++ plog/branches/lifetype-1.2/class/test/tests/dao/articlecategories_test.class.php	2008-06-23 21:59:07 UTC (rev 6672)
@@ -17,13 +17,19 @@
 			$this->data = TestTools::createBlogScenario(
                 Array( "num_articles" => 5, "num_categories" => 3 ));
 
+			$this->article = TestTools::createArticle( $this->data["blog"]->getId(),
+                                                       $this->data["user"]->getId(),
+                                                       Array( $this->data["categories"][0]->getId()),
+                                                       POST_STATUS_DRAFT );
         }
 
         function tearDown(){
 			// delete the test data
-			//TestTools::deleteDaoTestData( $data["categories"] );
-			//TestTools::deleteDaoTestData( $data["articles"] );
-            TestTools::deleteDaoTestData( Array( $this->data["blog"], $this->data["user"] ));
+			TestTools::deleteDaoTestData( $this->data["articles"] );
+			TestTools::deleteDaoTestData( $this->data["categories"] );
+            TestTools::deleteDaoTestData( Array( $this->article,
+                                                 $this->data["blog"],
+                                                 $this->data["user"] ));
         }
         
 		/**
@@ -33,8 +39,8 @@
 		function testArticleCategoriesCounters()
 		{
 			// add an article to one of the categories
-			$article = TestTools::createArticle( $this->data["blog"]->getId(), $this->data["user"]->getId(), Array( $this->data["categories"][0]->getId()), POST_STATUS_DRAFT );
-			$this->assertTrue( $article, "Error creating test article!" );
+
+			$this->assertTrue( $this->article, "Error creating test article!" );
 			
 			// check that the counter has been updated
 			$articleCategories = new ArticleCategories();
@@ -48,7 +54,7 @@
 			              "WHERE id = ".$this->data["categories"][1]->getId());
 			// trigger a cache reset
 			$articleCategories->_cache->removeData( $this->data["categories"][1]->getId(), CACHE_ARTICLE_CATEGORIES );
-			// update the category, relaod it and check that the counters are correct again
+			// update the category, reload it and check that the counters are correct again
 			$tmp = $this->data["categories"][1];
 			$articleCategories->updateCategory( $tmp );
 			$updatedCat2 = $articleCategories->getCategory( $this->data["categories"][1]->getId());



More information about the pLog-svn mailing list