function CoderReviewCommentTest::testForExample in Coder 7.2
Tests functionality to detect i.e. and e.g. phrases in comments.
File
- coder_review/
tests/ coder_review_comment.test, line 122
Class
- CoderReviewCommentTest
- Tests the functionality of comment review rules in Coder_review module.
Code
function testForExample() {
$this
->assertCoderReviewFail($this->comment_header . "// Whatever, e.g. this is wrong.\n");
$this
->assertCoderReviewPass($this->comment_header . "// Whatever, e.g., this is right.\n");
$this
->assertCoderReviewFail($this->comment_header . "// Whatever, (eg this is wrong).\n");
$this
->assertCoderReviewFail($this->comment_header . "// Whatever, (eg, this is wrong).\n");
$this
->assertCoderReviewPass($this->comment_header . "// Whatever, (e.g., this is right).\n");
$this
->assertCoderReviewFail($this->comment_header . "// Whatever, i.e., this is wrong.\n");
$this
->assertCoderReviewPass($this->comment_header . "// Whatever, i.e. this is right.\n");
$this
->assertCoderReviewFail($this->comment_header . "// Whatever, (ie this is wrong).\n");
$this
->assertCoderReviewFail($this->comment_header . "// Whatever, ie this is wrong.\n");
$this
->assertCoderReviewFail($this->comment_header . "// ie stands for example, and this is not OK.\n");
$this
->assertCoderReviewPass($this->comment_header . "// IE stands for Internet Explorer, and this is OK.\n");
$this
->assertCoderReviewFail($this->comment_header . " return t('Whatever, e.g. this is wrong.');\n");
$this
->assertCoderReviewPass($this->comment_header . " return t('Whatever, e.g., this is right.');\n");
$this
->assertCoderReviewFail($this->comment_header . " return t('Whatever, (eg this is wrong).');\n");
$this
->assertCoderReviewFail($this->comment_header . " return t('Whatever, (eg, this is wrong).');\n");
$this
->assertCoderReviewPass($this->comment_header . " return t('Whatever, (e.g., this is right).');\n");
$this
->assertCoderReviewFail($this->comment_header . " return t('Whatever, i.e., this is wrong.');\n");
$this
->assertCoderReviewPass($this->comment_header . " return t('Whatever, i.e. this is right.');\n");
$this
->assertCoderReviewFail($this->comment_header . " return t('Whatever, (ie this is wrong).');\n");
$this
->assertCoderReviewFail($this->comment_header . " return t('Whatever, ie this is wrong.');\n");
$this
->assertCoderReviewFail($this->comment_header . " return t('ie stands for example, and this is not OK.');\n");
$this
->assertCoderReviewPass($this->comment_header . " return t('IE stands for Internet Explorer, and this is OK.');\n");
}