You are here

function CoderReviewStyleTest::testStyleArrayIndex in Coder 7.2

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

Tests for the correct formatting of an array index.

File

coder_review/tests/coder_review_style.test, line 36

Class

CoderReviewStyleTest
Class to test for the style of the required Drupal coding standards.

Code

function testStyleArrayIndex() {
  $this
    ->assertCoderReviewPass('$some_array[FOO_BAR] = $baz;');
  $this
    ->assertCoderReviewFail('$some_array[foo_bar] = $baz;');
  $this
    ->assertCoderReviewFail('  $a[hello] = "hello";');
  $this
    ->assertCoderReviewPass('  $a[\'hello\'] = "hello";');
}