You are here

function CoderReviewUpgrade7xTest::testUser7x in Coder 7

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

File

coder_review/tests/coder_review_7x.test, line 520

Class

CoderReviewUpgrade7xTest

Code

function testUser7x() {

  // N/A - http://drupal.org/node/224333#specified_ids
  // http://drupal.org/node/224333#user_cancel
  $this
    ->assertCoderReviewFail('  user_delete($edit, $uid);');
  $this
    ->assertCoderReviewPass('  foo_user_delete($edit, $uid);');
  $this
    ->assertCoderReviewPass('  function foo_user_delete($edit, $uid)');

  // http://drupal.org/node/224333#remove_op
  $this
    ->assertCoderReviewFail("  function mymodule_user(");

  // http://drupal.org/node/224333#logout_path
  $this
    ->assertCoderReviewFail('  drupal_goto(\'logout\');');
  $this
    ->assertCoderReviewPass("  drupal_goto('user/logout');");
  $this
    ->assertCoderReviewFail('  $form_state[\'redirect\'] = \'logout\';');
  $this
    ->assertCoderReviewFail('  l(\'my text\', \'logout\');');
  $this
    ->assertCoderReviewFail('  l(t(\'my text\'), \'logout\');');
  $this
    ->assertCoderReviewFail('  l($text, \'logout\');');
  $this
    ->assertCoderReviewPass("  \$form_state['redirect'] = 'user/logout';");
  $this
    ->assertCoderReviewPass("  l('my text', 'user/logout');");
  $this
    ->assertCoderReviewPass("  l(t('my text'), 'user/logout');");
  $this
    ->assertCoderReviewPass("  l(\$text, 'user/logout');");

  // http://drupal.org/node/224333#user_load_multiple
  $this
    ->assertCoderReviewPass('  user_load($uid);');
  $this
    ->assertCoderReviewFail('  $user = user_load((array) $uid);');
  $this
    ->assertCoderReviewFail('  $user = user_load(array(123));');

  // http://drupal.org/node/224333#user_authenticate
  $this
    ->assertCoderReviewPass('  user_authenticate($username, $password);');
  $this
    ->assertCoderReviewFail('  user_authenticate(&$form_state);');

  // http://drupal.org/node/224333#hook-user-changes
  $this
    ->assertCoderReviewFail('  function mymodule_profile_alter(');
}