You are here

function CoderReviewSecurityTest::testSecurityBlockSubject in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_review/tests/coder_review_security.test \CoderReviewSecurityTest::testSecurityBlockSubject()

File

coder_review/tests/coder_review_security.test, line 254

Class

CoderReviewSecurityTest

Code

function testSecurityBlockSubject() {
  $this
    ->assertCoderReviewPass("  function mymodule_block() {\n  \$block['subject'] = 'title';\n}");
  $this
    ->assertCoderReviewPass("  function mymodule_block() {\n  \$block['subject'] = check_plain(\$title);\n}");
  $this
    ->assertCoderReviewFail("  function mymodule_block() {\n  \$block['subject'] = \$title;\n}");
  $this
    ->assertCoderReviewFail("  function mymodule_block() {\n  \$block = array(\n 'subject' => \$title,\n  );\n}");
}