/** * Get the content of the filter target. * @param {string} $cfTarget Target identifier. * @param {ae_CommentModel} $co The comment. * @return {string} Target content. */ protected static function getTarget($cfTarget, ae_CommentModel $co) { switch ($cfTarget) { case ae_CommentfilterModel::TARGET_CONTENT: $target = $co->getContent(); break; case ae_CommentfilterModel::TARGET_EMAIL: $target = $co->getAuthorEmail(); break; case ae_CommentfilterModel::TARGET_IP: $target = $co->getAuthorIp(); break; case ae_CommentfilterModel::TARGET_NAME: $target = $co->getAuthorName(); break; case ae_CommentfilterModel::TARGET_URL: $target = $co->getAuthorUrl(); break; case ae_CommentfilterModel::TARGET_USERID: $target = $co->getUserId(); break; default: $target = NULL; } return $target; }
public function testSetContent() { $c = new ae_CommentModel(); $c->setContent(' lorem <strong>ipsum</strong> '); $this->assertEquals($c->getContent(), 'lorem <strong>ipsum</strong>'); }