public function newForum($title, $description) { $forum = new sfSimpleForumForum(); $forum->setName($title); $forum->setDescription($description); $forum->setCategoryId($this->getId()); $forum->save(); return $forum; }
// initialize database manager $databaseManager = new sfDatabaseManager(); $databaseManager->initialize(); $con = Propel::getConnection(); // cleanup database sfSimpleForumCategoryPeer::doDeleteAll(); sfSimpleForumForumPeer::doDeleteAll(); sfSimpleForumPostPeer::doDeleteAll(); // Now we can start to test $t = new lime_test(34, new lime_output_color()); // Initialization $cat = new sfSimpleForumCategory(); $cat->save(); $forum = new sfSimpleForumForum(); $forum->setCategoryId($cat->getId()); $forum->save(); $topic = new sfSimpleForumTopic(); $topic->setTitle('This is a test'); $topic->setsfSimpleForumForum($forum); $topic->save(); $user0 = new sfGuardUser(); $user0->setUsername('me'); $user0->setPassword('me'); $user0->save(); $user1 = new sfGuardUser(); $user1->setUsername('foo'); $user1->setPassword('foo'); $user1->save(); $user2 = new sfGuardUser(); $user2->setUsername('bar'); $user2->setPassword('bar');