You are here

function CoderStyleTest::testStyleControlStructures in Coder 6.2

File

tests/coder_style.test, line 72

Class

CoderStyleTest

Code

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