You are here

protected function DeprecatedUnitTest::getErrorList in Coder 8.3.x

Same name and namespace in other branches
  1. 8.3 tests/Drupal/Commenting/DeprecatedUnitTest.php \Drupal\Test\Commenting\DeprecatedUnitTest::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.

There are three deprecated sniffs which produce an error: 'IncorrectTextLayout - for the basic deprecation text, sometimes fixable. 'MissingExtraInfo' - when there is no extra info after the main text. 'DeprecatedMissingSeeTag' - when there is no

Parameters

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

Return value

array<int, int>

Overrides CoderSniffUnitTest::getErrorList

See also

tag.

File

tests/Drupal/Commenting/DeprecatedUnitTest.php, line 26

Class

DeprecatedUnitTest

Namespace

Drupal\Test\Commenting

Code

protected function getErrorList(string $testFile) : array {
  return [
    // Basic layout is wrong. Missing see url.
    24 => 2,
    // No details given, check that the test gives two errors.
    75 => 2,
    // Layout OK but missing the extra info.
    81 => 1,
    // Text layout is wrong but fixable.
    89 => 1,
    // Text layout is wrong but fixable.
    98 => 1,
    // See Url has trailing punctuation which is fixable.
    101 => 1,
  ];
}