You are here

protected function EndFileNewlineUnitTest::getErrorList in Coder 8.3.x

Same name and namespace in other branches
  1. 8.3 tests/Drupal/Files/EndFileNewlineUnitTest.php \Drupal\Test\Files\EndFileNewlineUnitTest::getErrorList()

Returns the lines where errors should occur.

The key of the array should represent the line number and the value should represent the number of errors that should occur on that line.

Parameters

string $testFile The name of the file being tested.:

Return value

array<int, int>

Overrides CoderSniffUnitTest::getErrorList

File

tests/Drupal/Files/EndFileNewlineUnitTest.php, line 21

Class

EndFileNewlineUnitTest

Namespace

Drupal\Test\Files

Code

protected function getErrorList(string $testFile) : array {

  // All the good files have no error.
  if (strpos($testFile, 'good') !== false) {
    return [];
  }
  else {

    // All other files have one error on line one (they have all just one
    // code line in them).
    return [
      1 => 1,
    ];
  }
}