You are here

function TokenCommentTestCase::testCommentTokens in Token 6

Same name and namespace in other branches
  1. 7 token.test \TokenCommentTestCase::testCommentTokens()

File

./token.test, line 378
Tests for the token module.

Class

TokenCommentTestCase

Code

function testCommentTokens() {
  $time = time();
  $comment = $this
    ->createComment(array(
    'timestamp' => gmmktime(0, 0, 0, 7, 4, 1984),
  ));
  $tokens = array(
    'comment-cid' => $comment->cid,
    'comment-nid' => $this->node->nid,
    'comment-yyyy' => '1984',
    'comment-yy' => '84',
    'comment-month' => 'July',
    'comment-mon' => 'Jul',
    'comment-mm' => '07',
    'comment-m' => '7',
    'comment-ww' => '27',
    'comment-date' => '3',
    'comment-day' => 'Wednesday',
    'comment-ddd' => 'Wed',
    'comment-dd' => '04',
    'comment-d' => '4',
    'comment-raw' => '457747200',
    'comment-since' => format_interval($time - 457747200),
    'comment-node-title' => check_plain($this->node->title),
    'comment-node-title-raw' => $this->node->title,
  );
  $this
    ->assertTokens('comment', $comment, $tokens);
}