You are here

function simpletest_get_file_count in SimpleTest 7

Get the number of files that have the specified filename base.

2 calls to simpletest_get_file_count()
simpletest_generate_file in ./simpletest.install
Generate test file.
simpletest_install in ./simpletest.install
Implement hook_install().

File

./simpletest.install, line 88
Install, update and uninstall functions for the simpletest module.

Code

function simpletest_get_file_count($directory, $filename) {
  $files = scandir($directory);
  $count = 0;
  foreach ($files as $file) {
    if (preg_match('/' . $filename . '.*?/', $file)) {
      $count++;
    }
  }
  return $count;
}