<commit_before><?php

namespace TrueNorth\OpenCFP;

require_once 'web/vendor/autoload.php';

class ConfigurationTest extends \PHPUnit_Framework_TestCase {

    public function testGetPDODSNDefault()
    {
        putenv(Configuration::OPENCFP_PDO_DSN);
        $configuration = new Configuration();
        $dsn = $configuration->getPDODSN();
        $this->assertEquals(
            "sqlite::memory:",
            $dsn,
            "The default PDO DSN is in-memory sqlite"
        );
    }

    public function testGetPDODSNFromEnvironment()
    {
        $expected = 'mysql:dbname=cfp;host=localhost';
        putenv(Configuration::OPENCFP_PDO_DSN . '=' . $expected);
        $configuration = new Configuration();
        $dsn = $configuration->getPDODSN();
        $this->assertEquals(
            $expected,
            $dsn,
            "The PDO DSN is " . $expected
        );
    }

    public function testGetPDOUserDefault()
    {
        putenv(Configuration::OPENCFP_PDO_USER);
        $configuration = new Configuration();
        $user = $configuration->getPDOUser();
        $this->assertEquals(
            "root",
            $user,
            "The default MySQL user is root"
        );
    }

    public function testGetPDOUserFromEnvironment()
    {
        $expected = 'testUserName';
        putenv(Configuration::OPENCFP_PDO_USER . '=' . $expected);
        $configuration = new Configuration();
        $user = $configuration->getPDOUser();
        $this->assertEquals(
            $expected,
            $user,
            "The MySQL user is " . $expected
        );
    }

    public function testGetPDOPasswordDefault()
    {
        putenv(Configuration::OPENCFP_PDO_PASSWORD);
        $configuration = new Configuration();
        $password = $configuration->getPDOPassword();
        $this->assertEquals(
            "",
            $password,
            "The default MySQL password is blank"
        );
    }

    public function testGetPDOPasswordFromEnvironment()
    {
        $expected = 'testPassword';
        putenv(Configuration::OPENCFP_PDO_PASSWORD . '=' . $expected);
        $configuration = new Configuration();
        $password = $configuration->getPDOPassword();
        $this->assertEquals(
            $expected,
            $password,
            "The MySQL user is " . $expected
        );
    }
}
<commit_msg>Fixed correct path to the autoloader<commit_after><?php

namespace TrueNorth\OpenCFP;

require_once '../web/vendor/autoload.php';

class ConfigurationTest extends \PHPUnit_Framework_TestCase {

    public function testGetPDODSNDefault()
    {
        putenv(Configuration::OPENCFP_PDO_DSN);
        $configuration = new Configuration();
        $dsn = $configuration->getPDODSN();
        $this->assertEquals(
            "sqlite::memory:",
            $dsn,
            "The default PDO DSN is in-memory sqlite"
        );
    }

    public function testGetPDODSNFromEnvironment()
    {
        $expected = 'mysql:dbname=cfp;host=localhost';
        putenv(Configuration::OPENCFP_PDO_DSN . '=' . $expected);
        $configuration = new Configuration();
        $dsn = $configuration->getPDODSN();
        $this->assertEquals(
            $expected,
            $dsn,
            "The PDO DSN is " . $expected
        );
    }

    public function testGetPDOUserDefault()
    {
        putenv(Configuration::OPENCFP_PDO_USER);
        $configuration = new Configuration();
        $user = $configuration->getPDOUser();
        $this->assertEquals(
            "root",
            $user,
            "The default MySQL user is root"
        );
    }

    public function testGetPDOUserFromEnvironment()
    {
        $expected = 'testUserName';
        putenv(Configuration::OPENCFP_PDO_USER . '=' . $expected);
        $configuration = new Configuration();
        $user = $configuration->getPDOUser();
        $this->assertEquals(
            $expected,
            $user,
            "The MySQL user is " . $expected
        );
    }

    public function testGetPDOPasswordDefault()
    {
        putenv(Configuration::OPENCFP_PDO_PASSWORD);
        $configuration = new Configuration();
        $password = $configuration->getPDOPassword();
        $this->assertEquals(
            "",
            $password,
            "The default MySQL password is blank"
        );
    }

    public function testGetPDOPasswordFromEnvironment()
    {
        $expected = 'testPassword';
        putenv(Configuration::OPENCFP_PDO_PASSWORD . '=' . $expected);
        $configuration = new Configuration();
        $password = $configuration->getPDOPassword();
        $this->assertEquals(
            $expected,
            $password,
            "The MySQL user is " . $expected
        );
    }
}

{'fraction_non_alphanumeric': 0.11426767676767677, 'fraction_numerical': 0.0, 'mean_word_length': 2.1004566210045663, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '5496705', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1286, 'n_words': 251}