You are here

class FunctionCommentUnitTest in Coder 8.3.x

Same name and namespace in other branches
  1. 8.3 tests/Drupal/Commenting/FunctionCommentUnitTest.php \Drupal\Test\Commenting\FunctionCommentUnitTest

Hierarchy

Expanded class hierarchy of FunctionCommentUnitTest

File

tests/Drupal/Commenting/FunctionCommentUnitTest.php, line 7

Namespace

Drupal\Test\Commenting
View source
class FunctionCommentUnitTest extends CoderSniffUnitTest {

  /**
   * 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.
   *
   * @param string $testFile The name of the file being tested.
   *
   * @return array<int, int>
   */
  protected function getErrorList(string $testFile) : array {
    switch ($testFile) {
      case 'FunctionCommentUnitTest.inc':
        return [
          12 => 1,
          14 => 1,
          33 => 1,
          43 => 1,
          53 => 1,
          62 => 1,
          71 => 1,
          78 => 1,
          87 => 1,
          92 => 1,
          101 => 1,
          113 => 1,
          126 => 2,
          147 => 1,
          148 => 2,
          180 => 1,
          187 => 1,
          195 => 1,
          205 => 1,
          215 => 1,
          216 => 1,
          225 => 3,
          233 => 1,
          235 => 1,
          237 => 1,
          248 => 1,
          250 => 1,
          252 => 1,
          254 => 1,
          256 => 1,
          285 => 1,
          298 => 1,
          308 => 1,
          311 => 1,
          321 => 1,
          324 => 1,
          334 => 1,
          345 => 1,
          357 => 1,
          360 => 1,
          371 => 1,
          374 => 1,
          389 => 2,
          390 => 2,
          401 => 1,
          414 => 1,
          416 => 1,
          426 => 2,
          427 => 2,
          450 => 1,
          460 => 1,
        ];
      case 'FunctionCommentUnitTest.1.inc':
        return [];
      case 'FunctionCommentUnitTest.2.inc':
        return [
          8 => 1,
        ];
    }

    //end switch
    return [];
  }

  //end getErrorList()

  /**
   * Returns the lines where warnings should occur.
   *
   * The key of the array should represent the line number and the value
   * should represent the number of warnings that should occur on that line.
   *
   * @param string $testFile The name of the file being tested.
   *
   * @return array<int, int>
   */
  protected function getWarningList(string $testFile) : array {
    return [];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CoderSniffUnitTest::$backupGlobals protected property Enable or disable the backup and restoration of the $GLOBALS array. Overwrite this attribute in a child class of TestCase. Setting this attribute in setUp() has no effect!
CoderSniffUnitTest::$rootDir private property The path to the root folder of Coder.
CoderSniffUnitTest::$standardsDir public property The path to the standard's main directory.
CoderSniffUnitTest::$testsDir public property The path to the standard's test directory.
CoderSniffUnitTest::checkAllSniffCodes protected function False if just the current sniff should be checked, true if all sniffs should be checked. 3
CoderSniffUnitTest::compatibleSetUp protected function Sets up this unit test.
CoderSniffUnitTest::generateFailureMessages public function Generate a list of test failures for a given sniffed file.
CoderSniffUnitTest::getTestFiles protected function Get a list of all test files to check. 20
CoderSniffUnitTest::setCliValues public function Set a list of CLI values before the file is tested.
CoderSniffUnitTest::shouldSkipTest protected function Should this test be skipped for some reason.
CoderSniffUnitTest::testSniff final public function Tests the extending classes Sniff class.
FunctionCommentUnitTest::getErrorList protected function Returns the lines where errors should occur. Overrides CoderSniffUnitTest::getErrorList
FunctionCommentUnitTest::getWarningList protected function Returns the lines where warnings should occur. Overrides CoderSniffUnitTest::getWarningList