<commit_before><?php
require_once 'core/slir.class.php';

abstract class SLIRTestCase extends PHPUnit_Framework_TestCase
{
  protected function setUp()
  {
    $slir = new SLIR();
    $slir->getConfig();
    SLIRConfig::$defaultImagePath = null;
    SLIRConfig::$forceQueryString = false;

    // Try to fix documentRoot for CLI
    SLIRConfig::$documentRoot = preg_replace('`/slir/?$`', '', SLIRConfig::$documentRoot);
  }
}
<commit_msg>Set up the instance of SLIR as a property of the object so it can be used by test cases if we want to.<commit_after><?php
require_once 'core/slir.class.php';

abstract class SLIRTestCase extends PHPUnit_Framework_TestCase
{
  /**
   * @var SLIR
   */
  protected $slir;

  /**
   * @return void
   */
  protected function setUp()
  {
    $this->slir = new SLIR();
    $this->slir->getConfig();
    SLIRConfig::$defaultImagePath = null;
    SLIRConfig::$forceQueryString = false;

    // Try to fix documentRoot for CLI
    SLIRConfig::$documentRoot = preg_replace('`/slir/?$`', '', SLIRConfig::$documentRoot);
  }

  /**
   * @return void
   */
  protected function tearDown()
  {
    unset($this->slir);
  }
}

{'fraction_non_alphanumeric': 0.1409921671018277, 'fraction_numerical': 0.0, 'mean_word_length': 3.5816733067729083, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6247704', 'n_tokens_mistral': 377, 'n_tokens_neox': 379, 'n_words': 91}