/**
  * 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;
 }
Example #2
0
 public function testSetAuthorName()
 {
     $c = new ae_CommentModel();
     $c->setAuthorName('  Ein  Bär ');
     $this->assertEquals($c->getAuthorName(), 'Ein  Bär');
 }