/**
  * Test fetch of N favorited posts for a given user by userid
  */
 public function testGetAllFavsForUserID()
 {
     $this->dao = new FavoritePostMySQLDAO();
     $res = $this->dao->getAllFavoritePosts(20, 'twitter', 6, 1, false);
     //not public
     $this->assertIsA($res, "array");
     $this->assertEqual(count($res), 6);
     $this->assertEqual($res[0]->post_text, 'This is link post 19');
     $this->assertEqual($res[1]->post_text, 'This is link post 18');
     $i = 0;
     while ($i < 6) {
         $this->debug($res[$i]->post_text);
         $i++;
     }
     // just check that we get the same result w/out the explicit arg
     $res = $this->dao->getAllFavoritePosts(20, 'twitter', 6);
     //not public
     $this->assertIsA($res, "array");
     $this->assertEqual(count($res), 6);
     $this->assertEqual($res[0]->post_text, 'This is link post 19');
     $this->assertEqual($res[1]->post_text, 'This is link post 18');
     //iterator
     $res = $this->dao->getAllFavoritePostsIterator(20, 'twitter', 6);
     $this->assertIsA($res, "PostIterator");
     $i = 0;
     while ($i < 6) {
         $this->assertTrue($res->valid());
         $seeme = $res->current();
         $this->debug($seeme->post_text);
         $res->next();
         $i++;
     }
     $this->assertFalse($res->valid());
 }
 /**
  * Test fetch of N favorited posts for a given user by userid
  */
 public function testGetAllFavsForUserID()
 {
     $this->dao = new FavoritePostMySQLDAO();
     $res = $this->dao->getAllFavoritePosts(20, 'twitter', 6);
     $this->assertIsA($res, "array");
     $this->assertEqual(count($res), 6);
     $this->assertEqual($res[0]->post_text, 'This is link post 19');
     $i = 0;
     while ($i < 6) {
         $this->debug($res[$i]->post_text);
         $i++;
     }
     //iterator
     $res = $this->dao->getAllFavoritePostsIterator(20, 'twitter', 6);
     $this->assertIsA($res, "PostIterator");
     $i = 0;
     while ($i < 6) {
         $this->assertTrue($res->valid());
         $seeme = $res->current();
         $this->debug($seeme->post_text);
         $res->next();
         $i++;
     }
     $this->assertFalse($res->valid());
 }