You are here

function CoderReviewUpgrade6xTest::testUpgrade6xFile in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_review/tests/coder_review_6x.test \CoderReviewUpgrade6xTest::testUpgrade6xFile()

File

coder_review/tests/coder_review_6x.test, line 112

Class

CoderReviewUpgrade6xTest

Code

function testUpgrade6xFile() {
  $this
    ->assertCoderReviewFail('  if ($file = file_check_upload(\'picture_upload\')) {');
  $this
    ->assertCoderReviewFail('  $file = file_save_upload(\'picture_upload\', $destination, FILE_EXISTS_REPLACE); ');
  $this
    ->assertCoderReviewFail('  $file = file_save_upload(\'picture_upload\', $dest); ');
  $this
    ->assertCoderReviewFail('  $file = file_save_upload(\'picture_upload\', \'abc\'); ');
  $this
    ->assertCoderReviewFail('  $file = file_save_upload(\'picture_upload\', "abc"); ');
  $this
    ->assertCoderReviewPass('  $file = file_save_upload(\'picture_upload\', array(\'foo\')); ');
  $this
    ->assertCoderReviewPass('  if ($file = file_save_upload(\'picture_upload\', $validators, $dest)) {');
  $this
    ->assertCoderReviewFail('  $sql = \'UPDATE {file_revisions} SET vid=1');
  $this
    ->assertCoderReviewFail('  if (db_query(\'SELECT * FROM {file_revisions}\')) {');
}