function CoderReviewSecurityTest::testSecurityCheckPlain in Coder 7.2
Same name and namespace in other branches
- 7 coder_review/tests/coder_review_security.test \CoderReviewSecurityTest::testSecurityCheckPlain()
Tests functionality to detect correct use of Drupal check_plain() function.
File
- coder_review/
tests/ coder_review_security.test, line 36
Class
- CoderReviewSecurityTest
- Tests the Coder_review functionality to detect security-related rules.
Code
function testSecurityCheckPlain() {
$this
->assertCoderReviewFail('$var = l(check_plain($input), "path/to/drupal");');
$this
->assertCoderReviewFail('$var = l(check_plain($input), "path/to/drupal", array("html" => FALSE);');
$this
->assertCoderReviewFail('$var = l(check_plain($input), "path/to/drupal", array("html" => $value);');
$this
->assertCoderReviewFail('$var = l(check_plain($input), "path/to/drupal", array("html" => 0);');
$this
->assertCoderReviewPass('$var = l(check_plain($input), "path/to/drupal", array("html" => TRUE);');
$this
->assertCoderReviewPass('$var = l(check_plain($input), "path/to/drupal", array(\'html\' => TRUE);');
$this
->assertCoderReviewPass('$var = l(check_plain($input), "path/to/drupal", array("html" => 1);');
$this
->assertCoderReviewPass('$var = l(check_plain($input), "path/to/drupal", array(\'html\' => 1);');
}