コード例 #1
0
ファイル: AnonymousUserTest.php プロジェクト: Benjen/red_test
 /**
  * Make sure that user is anonymous.
  */
 public static function setupBeforeClass()
 {
     $userObject = User::loginProgrammatically(1)->verify(get_class());
     self::$articleObject = Article::createRandom()->verify(get_class());
     /**
      * @todo ArticleComment::createDefault doesn't work yet. Need to fix it.
      */
     /*list($success, self::$articleCommentObject, $msg) = ArticleComment::createDefault(
         1,
         array('nid' => self::$articleObject->getId())
       );*/
     $articleCommentForm = new ArticleCommentForm(NULL, self::$articleObject->getId());
     $articleCommentForm->verify(get_class());
     $fields = $articleCommentForm->fillRandomValues()->verify(get_class());
     self::$articleCommentObject = $articleCommentForm->submit()->verify(get_class());
     self::$articleCommentObject->checkValues($fields)->verify(get_class());
     User::logout();
 }
コード例 #2
0
ファイル: SuperUserTest.php プロジェクト: Benjen/red_test
 /**
  * Make sure that superuser is able to reply to his own comment.
  *
  * @depends testCommentReplyAccess
  */
 public function testCommentReply()
 {
     $articleReplyForm = new ArticleCommentForm(NULL, self::$articleObject->getId(), self::$articleCommentObject->getId());
     $articleReplyForm->verify($this);
     $fields = $articleReplyForm->fillRandomValues(self::$options)->verify($this);
     self::$articleReplyObject = $articleReplyForm->submit()->verify($this);
     self::$articleReplyObject->checkValues($fields)->verify($this);
 }