<commit_before><?php
namespace Pumpkin;

/**
 * Class TestCase
 * @package Pumpkin
 * @author <NAME> <<EMAIL>>
 */
abstract class TestCase extends \PHPUnit_Extensions_Database_TestCase
{


}<commit_msg>init connection<commit_after><?php
namespace Pumpkin;

/**
 * Class TestCase
 * @package Pumpkin
 * @author <NAME> <<EMAIL>>
 */
abstract class TestCase extends \PHPUnit_Extensions_Database_TestCase
{

    /**
     * main db connection.
     *
     * @var \PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection
     */
    private static $connection;

    /**
     * {@inheritDoc}
     *
     * @return \PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection
     */
    protected function getConnection()
    {
        if (null === self::$connection) {
            $this->setConnection($this->buildConnection());
        }
        return self::$connection;
    }

    /**
     * Setter of $connection.
     *
     * @param \PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection $connection
     */
    private function setConnection(\PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection $connection)
    {
        self::$connection = $connection;
    }

    /**
     * Builder of connection.
     *
     * @return \PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection
     */
    private function buildConnection()
    {
        return $this->createDefaultDBConnection(
            new \PDO(
                $GLOBALS['db_dsn'],
                $GLOBALS['db_username'],
                $GLOBALS['db_password']
            )
        );
    }
}

{'fraction_non_alphanumeric': 0.10954516335682254, 'fraction_numerical': 0.0, 'mean_word_length': 2.5990783410138247, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, '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': '4977673', 'n_tokens_mistral': 435, 'n_tokens_neox': 426, 'n_words': 78}