Exemple #1
0
 /**
  * @depends testAddIdea
  */
 public function test_createThread($idea_id)
 {
     $Idea = new Idea($idea_id);
     $Category = new ForumCategory();
     $Category->title = "Ideas";
     $Category->commit();
     $Forum = new Forum();
     $Forum->setCategory($Category);
     $Forum->name = "Ideas forum";
     $Forum->commit();
     $Thread = new Thread();
     $Thread->title = $Idea->title;
     $Thread->setForum($Forum)->setAuthor($Idea->Author)->commit();
     $Post = new Post();
     $Post->text = $Idea->description;
     $Post->ip = "8.8.8.8";
     $Post->setAuthor($Idea->Author)->setThread($Thread)->commit();
     $this->assertFalse(!filter_var($Post->id, FILTER_VALIDATE_INT));
     return $Thread->id;
 }
Exemple #2
0
 /**
  * @depends testAddCategory
  */
 public function testBreakForum_validate_name($cat_id)
 {
     $Category = new Category($cat_id);
     $this->setExpectedException("Exception", "No forum name has been set");
     $Forum = new Forum();
     $Forum->category = $Category;
     $Forum->commit();
 }