You are here

function CoderReviewStyleTest::testStyleControlStructures in Coder 7

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

File

coder_review/tests/coder_review_style.test, line 71

Class

CoderReviewStyleTest

Code

function testStyleControlStructures() {
  $this
    ->assertCoderReviewFail('  if ($a == 1) { }');
  $this
    ->assertCoderReviewPass('  if ($a == 1) {');
  $this
    ->assertCoderReviewFail('  }else {');
  $this
    ->assertCoderReviewFail('  if ($a == 1) { $b = 2;');
  $this
    ->assertCoderReviewFail('  if ($a == 1) {$b = 2;');
  $this
    ->assertCoderReviewFail('  else if ($a == 1) {');
  $this
    ->assertCoderReviewPass('  elseif ($a == 1) {');
}