<commit_before><?php
require_once(dirname(dirname(__FILE__)) . '/config.test.php');
require_once(dirname(__FILE__) . '/simpletest/unit_tester.php');
require_once(dirname(__FILE__) . '/simpletest/mock_objects.php');
require_once(dirname(__FILE__) . '/simpletest/web_tester.php');
require_once(dirname(__FILE__) . '/kw_db.php'); 
/**
 * The test manager interface kw tests with simpletest test.
 *
 * @package    kwtests
 */
class TestManager 
{
  var $testDir  = null;
  var $database = null;
  
  function setDatabase($db){
    $this->database = $db;
  }
  
  
  /**
     * set the tests directory where the test files are placed
     * @param string $dir
     */
  function setTestDirectory($dir){
     $this->testDir = $dir;
  }
  
  /** Delete the log file */
  function removeLogAndBackupFiles($logfilename)
    {
    if (file_exists($logfilename))
      {
      unlink($logfilename);
      }
    $filenames = glob(dirname($logfilename)."/*.xml");
    foreach($filenames as $filename)
      {
      unlink($filename);
      }
    }
  function runFileTest(&$reporter, $file)
  {
    $test = &new GroupTest('All Tests');
    $path = $this->testDir.  "/" . $file;
    print "$path";
    $test->addTestFile($path);
    return $test->run($reporter);
  }
  /**
     * run all the tests
     * @return the result the test running 
     * @param object $reporter
     */
  function runAllTests(&$reporter) {
    $testsFile = $this->getTestCaseList();
    $test = &new GroupTest('All Tests');
    foreach($testsFile as $path=>$file)
      {
      print "$path";
      $test->addTestFile($path);
      }
    return $test->run($reporter);
  }

  /**
     * Match all the test files inside the test directory 
     * @return an array of the test files
     */
  function getTestCaseList() {
    if(!$this->testDir)
      {
      die ("please, set the test directory\n");
      }
    $testsFile = array();<commit_msg>STYLE: Remove printf<commit_after><?php
require_once(dirname(dirname(__FILE__)) . '/config.test.php');
require_once(dirname(__FILE__) . '/simpletest/unit_tester.php');
require_once(dirname(__FILE__) . '/simpletest/mock_objects.php');
require_once(dirname(__FILE__) . '/simpletest/web_tester.php');
require_once(dirname(__FILE__) . '/kw_db.php'); 
/**
 * The test manager interface kw tests with simpletest test.
 *
 * @package    kwtests
 */
class TestManager 
{
  var $testDir  = null;
  var $database = null;
  
  function setDatabase($db){
    $this->database = $db;
  }
  
  
  /**
     * set the tests directory where the test files are placed
     * @param string $dir
     */
  function setTestDirectory($dir){
     $this->testDir = $dir;
  }
  
  /** Delete the log file */
  function removeLogAndBackupFiles($logfilename)
    {
    if (file_exists($logfilename))
      {
      unlink($logfilename);
      }
    $filenames = glob(dirname($logfilename)."/*.xml");
    foreach($filenames as $filename)
      {
      unlink($filename);
      }
    }
  function runFileTest(&$reporter, $file)
  {
    $test = &new GroupTest('All Tests');
    $path = $this->testDir.  "/" . $file;
    print "$path";
    $test->addTestFile($path);
    return $test->run($reporter);
  }
  /**
     * run all the tests
     * @return the result the test running 
     * @param object $reporter
     */
  function runAllTests(&$reporter) {
    $testsFile = $this->getTestCaseList();
    $test = &new GroupTest('All Tests');
    foreach($testsFile as $path=>$file)
      {
      $test->addTestFile($path);
      }
    return $test->run($reporter);
  }

  /**
     * Match all the test files inside the test directory 
     * @return an array of the test files
     */
  function getTestCaseList() {
    if(!$this->testDir)
      {
      die ("please, set the test directory\n");
      }
    $testsFile = array();
{'fraction_non_alphanumeric': 0.15228826933193057, 'fraction_numerical': 0.0, 'mean_word_length': 2.8375378405650857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '651233', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1212, 'n_words': 273}