You are here

function CoderReviewStyleTest::testStyleStringConcatentation in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_review/tests/coder_review_style.test \CoderReviewStyleTest::testStyleStringConcatentation()

File

coder_review/tests/coder_review_style.test, line 81

Class

CoderReviewStyleTest

Code

function testStyleStringConcatentation() {
  $this
    ->assertCoderReviewPass('  if ($file = file_check_upload($fieldname . "_upload")) {');
  $this
    ->assertCoderReviewFail('  if ($file = file_check_upload($fieldname ."_upload")) {');
  $this
    ->assertCoderReviewPass('  $v .= \'string\';');
  $this
    ->assertCoderReviewPass('  $a = $v . \'string\';');
  $this
    ->assertCoderReviewPass('  $a = $v . "string";');
  $this
    ->assertCoderReviewPass('  $a = "string" . $v;');
  $this
    ->assertCoderReviewPass('  $a = \'string\' . $v;');
  $this
    ->assertCoderReviewFail('  $a = "string". $v;');
  $this
    ->assertCoderReviewFail('  $a = \'string\'. $v;');
  $this
    ->assertCoderReviewFail('  $a = $v. \'string\';');
  $this
    ->assertCoderReviewFail('  $a = $v. "string";');
  $this
    ->assertCoderReviewFail('  $a = $v .\'string\';');
  $this
    ->assertCoderReviewFail('  $a = $v ."string";');
  $this
    ->assertCoderReviewFail('  $a = $v.\'string\';');
  $this
    ->assertCoderReviewFail('  $a = $v .  \'string\';');
  $this
    ->assertCoderReviewFail('  $a = $v .  "string";');
  $this
    ->assertCoderReviewFail('  $a = $v  . \'string\';');
  $this
    ->assertCoderReviewFail('  $a = $some_func(). \'string\';');
  $this
    ->assertCoderReviewPass('  $a = 1.0 * .1 * 1. * (0.1) * (1.) * (.1) * (1.0);');
}