class Drupal_GoodUnitTest in Coder 7.2
Unit test class for all good files that must not throw errors/warnings.
Hierarchy
- class \CoderSniffUnitTest extends \PHPUnit_Framework_TestCase
- class \Drupal_GoodUnitTest
Expanded class hierarchy of Drupal_GoodUnitTest
File
- coder_sniffer/
Test/ good/ GoodUnitTest.php, line 9
View source
class Drupal_GoodUnitTest 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)
*/
public function getErrorList($testFile) {
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)
*/
public function getWarningList($testFile) {
return array();
}
//end getWarningList()
/**
* Returns a list of test files that should be checked.
*
* @return array The list of test files.
*/
protected function getTestFiles() {
$dir = dirname(__FILE__);
$di = new DirectoryIterator($dir);
foreach ($di as $file) {
$path = $file
->getPathname();
if ($path !== __FILE__ && $file
->isFile()) {
$testFiles[] = $path;
}
}
// Get them in order.
sort($testFiles);
return $testFiles;
}
/**
* Returns a list of sniff codes that should be checked in this test.
*
* @return array The list of sniff codes.
*/
protected function getSniffCodes() {
// We want to test all sniffs defined in the standard.
return array();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CoderSniffUnitTest:: |
protected static | property | The PHP_CodeSniffer object used for testing. | |
CoderSniffUnitTest:: |
public | function | Generate a list of test failures for a given sniffed file. | |
CoderSniffUnitTest:: |
protected | function | Sets up this unit test. | |
CoderSniffUnitTest:: |
protected | function | Should this test be skipped for some reason. | |
CoderSniffUnitTest:: |
final public | function | Tests the extending classes Sniff class. | |
Drupal_GoodUnitTest:: |
public | function |
Returns the lines where errors should occur. Overrides CoderSniffUnitTest:: |
|
Drupal_GoodUnitTest:: |
protected | function |
Returns a list of sniff codes that should be checked in this test. Overrides CoderSniffUnitTest:: |
|
Drupal_GoodUnitTest:: |
protected | function |
Returns a list of test files that should be checked. Overrides CoderSniffUnitTest:: |
|
Drupal_GoodUnitTest:: |
public | function |
Returns the lines where warnings should occur. Overrides CoderSniffUnitTest:: |