You are here

class GlobalClassUnitTest in Coder 8.2

Hierarchy

Expanded class hierarchy of GlobalClassUnitTest

File

coder_sniffer/DrupalPractice/Test/Objects/GlobalClassUnitTest.php, line 7

Namespace

DrupalPractice\Sniffs\Objects
View source
class GlobalClassUnitTest 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.
   *
   * @return array(int => int)
   */
  protected function getErrorList($testFile = NULL) {
    return array();
  }

  //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.
   *
   * @return array(int => int)
   */
  protected function getWarningList($testFile = NULL) {
    switch ($testFile) {
      case 'GlobalClassUnitTest.inc':
        return array(
          8 => 1,
        );
      case 'ExampleService.php':
        return array(
          23 => 1,
        );
      default:
        return [];
    }
  }

  //end getWarningList()

  /**
   * Returns a list of test files that should be checked.
   *
   * @return array The list of test files.
   */
  protected function getTestFiles($testFileBase) {
    return [
      __DIR__ . '/GlobalClassUnitTest.inc',
      __DIR__ . '/src/ExampleService.php',
    ];
  }

}

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::$standardsDir public property The path to the standard's main directory.
CoderSniffUnitTest::$testsDir public property The path to the standard's test directory.
CoderSniffUnitTest::allSniffCodes protected function Returns a list of sniff codes that should be checked in this test. 3
CoderSniffUnitTest::generateFailureMessages public function Generate a list of test failures for a given sniffed file.
CoderSniffUnitTest::setCliValues public function Get a list of CLI values to set before the file is tested.
CoderSniffUnitTest::setUp protected function Sets up this unit test.
CoderSniffUnitTest::shouldSkipTest protected function Should this test be skipped for some reason.
CoderSniffUnitTest::testSniff final public function Tests the extending classes Sniff class.
GlobalClassUnitTest::getErrorList protected function Returns the lines where errors should occur. Overrides CoderSniffUnitTest::getErrorList
GlobalClassUnitTest::getTestFiles protected function Returns a list of test files that should be checked. Overrides CoderSniffUnitTest::getTestFiles
GlobalClassUnitTest::getWarningList protected function Returns the lines where warnings should occur. Overrides CoderSniffUnitTest::getWarningList