public function testInitializeData()
 {
     $query = new Doctrine_Query($this->connection);
     $cat = new QueryTest_Category();
     $cat->rootCategoryId = 0;
     $cat->parentCategoryId = 0;
     $cat->name = "Testcat";
     $cat->position = 0;
     $cat->save();
     $board = new QueryTest_Board();
     $board->name = "Testboard";
     $board->categoryId = $cat->id;
     $board->position = 0;
     $board->save();
     $author = new QueryTest_User();
     $author->username = "******";
     $author->save();
     $lastEntry = new QueryTest_Entry();
     $lastEntry->authorId = $author->id;
     $lastEntry->date = 1234;
     $lastEntry->save();
     // Set the last entry
     $board->lastEntry = $lastEntry;
     $board->save();
     $visibleRank = new QueryTest_Rank();
     $visibleRank->title = "Freak";
     $visibleRank->color = "red";
     $visibleRank->icon = "freak.png";
     $visibleRank->save();
     // grant him a rank
     $author->visibleRank = $visibleRank;
     $author->save();
 }
예제 #2
0
 public function testInitializeData()
 {
     $query = new Doctrine_Query($this->connection);
     $cat = new QueryTest_Category();
     $cat->rootCategoryId = 0;
     $cat->parentCategoryId = 0;
     $cat->name = "Cat1";
     $cat->position = 0;
     $cat->save();
     $board = new QueryTest_Board();
     $board->name = "B1";
     $board->categoryId = $cat->id;
     $board->position = 0;
     $board->save();
     $author = new QueryTest_User();
     $author->username = "******";
     $author->save();
     $lastEntry = new QueryTest_Entry();
     $lastEntry->authorId = $author->id;
     $lastEntry->date = 1234;
     $lastEntry->save();
 }