You are here

function CoderReviewUpgrade7xTest::testForm7x in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_review/tests/coder_review_7x.test \CoderReviewUpgrade7xTest::testForm7x()

???

File

coder_review/tests/coder_review_7x.test, line 498

Class

CoderReviewUpgrade7xTest
???

Code

function testForm7x() {

  // http://drupal.org/node/224333#poundtheme
  // http://drupal.org/node/224333#node_form
  $this
    ->assertCoderReviewFail("  function mymodule_form_alter(&\$form, &\$form_state, \$form_id) {\n  if (isset(\$form['type']) && isset(\$form['#node']) && \$form['type']['#value'] .'_node_form' == \$form_id)");
  $this
    ->assertCoderReviewFail("  function mymodule_form_alter(&\$form, &\$form_state, \$form_id) {\n  if (\$form['type']['#value'] .'_node_form' == \$form_id)");

  // No link - parameter change to hook_form_alter().
  $this
    ->assertCoderReviewFail("  function mymodule_form_alter(&\$form, \$form_state, \$form_id)");
  $this
    ->assertCoderReviewPass("  function mymodule_form_alter(&\$form, &\$form_state, \$form_id)");

  // http://drupal.org/node/224333#process_functions
  $this
    ->assertCoderReviewFail('  $form = array("#process" => "expand_password_confirm");');
  $this
    ->assertCoderReviewFail('  $form["#process"] = "expand_password_confirm";');
  $this
    ->assertCoderReviewFail('  $form["#process"] = "expand_date";');
  $this
    ->assertCoderReviewFail('  $form["#process"] = "expand_radios";');
  $this
    ->assertCoderReviewFail('  $form["#process"] = "form_expand_ahah";');
  $this
    ->assertCoderReviewFail('  $form["#process"] = "expand_checkboxes";');
  $this
    ->assertCoderReviewFail('  $form["#process"] = "process_weight";');

  // http://drupal.org/node/224333#markup
  // http://drupal.org/node/224333#drupal_execute_drupal_form_submit
  $this
    ->assertCoderReviewFail('  drupal_execute();');
  $this
    ->assertCoderReviewFail('  if (drupal_execute())');

  // http://drupal.org/node/224333#unrendered
  // http://drupal.org/node/224333#ahah_now_ajax
  $this
    ->assertCoderReviewFail('  $form["#ahah"] = "foo";');
  $this
    ->assertCoderReviewFail("  \$form['#ahah'] = 'foo';");
}