You are here

protected function GoodUnitTest::getTestFiles in Coder 8.3

Same name in this branch
  1. 8.3 tests/DrupalPractice/good/GoodUnitTest.php \DrupalPractice\Test\good\GoodUnitTest::getTestFiles()
  2. 8.3 tests/Drupal/good/GoodUnitTest.php \Drupal\Test\good\GoodUnitTest::getTestFiles()
Same name and namespace in other branches
  1. 8.3.x tests/Drupal/good/GoodUnitTest.php \Drupal\Test\good\GoodUnitTest::getTestFiles()

Returns a list of test files that should be checked.

Parameters

string $testFileBase The base path that the unit tests files will have.:

Return value

array<string>

Overrides CoderSniffUnitTest::getTestFiles

File

tests/Drupal/good/GoodUnitTest.php, line 58

Class

GoodUnitTest
Unit test class for all good files that must not throw errors/warnings.

Namespace

Drupal\Test\good

Code

protected function getTestFiles($testFileBase) : array {
  $di = new \DirectoryIterator(__DIR__);
  foreach ($di as $file) {
    $path = $file
      ->getPathname();
    if ($path !== __FILE__ && $file
      ->isFile() === true) {
      $testFiles[] = $path;
    }
  }
  $testFiles[] = __DIR__ . '/drupal8/LongNamespace.php';

  // Get them in order.
  sort($testFiles);
  return $testFiles;
}