<commit_before><?php
// backward compatibility (https://stackoverflow.com/a/42828632/187780)
if (!class_exists('\PHPUnit\Framework\TestCase') && class_exists('\PHPUnit_Framework_TestCase')) {
    class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
}

class CredisTestCommon extends \PHPUnit\Framework\TestCase
{
    protected $useStandalone = false;
    protected $redisConfig = null;
    protected $slaveConfig = null;

    protected function setUp()
    {
        if ($this->redisConfig === null)
        {
            $configFile = dirname(__FILE__) . '/redis_config.json';
            if (!file_exists($configFile) || !($config = file_get_contents($configFile)))
            {
                $this->markTestSkipped('Could not load ' . $configFile);

                return;
            }
            $this->redisConfig = json_decode($config);
            $arrayConfig = array();
            foreach ($this->redisConfig as $config)
            {
                $arrayConfig[] = (array)$config;
            }
            $this->redisConfig = $arrayConfig;
        }

        if($this->useStandalone && !extension_loaded('redis')) {
            $this->fail('The Redis extension is not loaded.');
        }
    }
<commit_msg>Fix testing standalone flag  && extension_loaded check<commit_after><?php
// backward compatibility (https://stackoverflow.com/a/42828632/187780)
if (!class_exists('\PHPUnit\Framework\TestCase') && class_exists('\PHPUnit_Framework_TestCase')) {
    class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
}

class CredisTestCommon extends \PHPUnit\Framework\TestCase
{
    protected $useStandalone = false;
    protected $redisConfig = null;
    protected $slaveConfig = null;

    protected function setUp()
    {
        if ($this->redisConfig === null)
        {
            $configFile = dirname(__FILE__) . '/redis_config.json';
            if (!file_exists($configFile) || !($config = file_get_contents($configFile)))
            {
                $this->markTestSkipped('Could not load ' . $configFile);

                return;
            }
            $this->redisConfig = json_decode($config);
            $arrayConfig = array();
            foreach ($this->redisConfig as $config)
            {
                $arrayConfig[] = (array)$config;
            }
            $this->redisConfig = $arrayConfig;
        }

        if(!$this->useStandalone && !extension_loaded('redis')) {
            $this->fail('The Redis extension is not loaded.');
        }
    }

{'fraction_non_alphanumeric': 0.13571990558615263, 'fraction_numerical': 0.011014948859166011, 'mean_word_length': 2.372679045092838, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '4482212', 'n_tokens_mistral': 716, 'n_tokens_neox': 700, 'n_words': 125}