<commit_before><?php namespace Zephyrus\Tests\Database;

use PHPUnit\Framework\TestCase;
use Zephyrus\Application\Configuration;
use Zephyrus\Database\Core\Database;

abstract class DatabaseTestCase extends TestCase
{
    public static function setUpBeforeClass(): void
    {
        $db = new Database(Configuration::getDatabaseConfiguration());
        $db->query("DROP TABLE IF EXISTS heroes");
        $db->query('CREATE TABLE heroes(id SERIAL PRIMARY KEY, name TEXT NULL, alter TEXT NULL, power FLOAT)');
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (1, 'Batman', '<NAME>', 20.56);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (2, 'Superman', '<NAME>', 10.10);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (3, 'Aquaman', '<NAME>', 23.50);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (4, 'Wonder Woman', '<NAME>', 12.67);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (5, 'Flash', '<NAME>', 5.89);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (6, 'Green Lantern', '<NAME>', 12.12);");
    }

    public static function tearDownAfterClass(): void
    {
        $db = new Database(Configuration::getDatabaseConfiguration());
        $db->query("DROP TABLE heroes");
    }

    public function rebootDatabase(Database $db)
    {
        $db->query("DROP TABLE IF EXISTS heroes");
        $db->query('CREATE TABLE heroes(id SERIAL PRIMARY KEY, name TEXT NULL, alter TEXT NULL, power FLOAT)');
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (1, 'Batman', '<NAME>', 20.56);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (2, 'Superman', '<NAME>', 10.10);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (3, 'Aquaman', '<NAME>', 23.50);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (4, 'Wonder Woman', '<NAME>', 12.67);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (5, 'Flash', '<NAME>', 5.89);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (6, 'Green Lantern', '<NAME>', 12.12);");
    }

    public function buildDatabase(): Database
    {
        return new Database(Configuration::getDatabaseConfiguration());
    }

    private function dropTable()
    {
        $db = new Database(Configuration::getDatabaseConfiguration());
        $db->query("DROP TABLE heroes");
    }
}<commit_msg>test: adjust default database data<commit_after><?php namespace Zephyrus\Tests\Database;

use PHPUnit\Framework\TestCase;
use Zephyrus\Application\Configuration;
use Zephyrus\Database\Core\Database;

abstract class DatabaseTestCase extends TestCase
{
    public static function setUpBeforeClass(): void
    {
        $db = new Database(Configuration::getDatabaseConfiguration());
        $db->query("DROP TABLE IF EXISTS heroes");
        $db->query('CREATE TABLE heroes(id SERIAL PRIMARY KEY, name TEXT NULL, alter TEXT NULL, power FLOAT)');
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (1, 'Batman', '<NAME>', 20.56);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (2, 'Superman', '<NAME>', 50.30);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (3, 'Aquaman', '<NAME>', 23.50);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (4, 'Wonder Woman', '<NAME>', 12.67);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (5, 'Flash', '<NAME>', 5.89);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (6, 'Green Lantern', 'Hal Jordan', 12.12);");
    }

    public static function tearDownAfterClass(): void
    {
        $db = new Database(Configuration::getDatabaseConfiguration());
        $db->query("DROP TABLE heroes");
    }

    public function rebootDatabase(Database $db)
    {
        $db->query("DROP TABLE IF EXISTS heroes");
        $db->query('CREATE TABLE heroes(id SERIAL PRIMARY KEY, name TEXT NULL, alter TEXT NULL, power FLOAT)');
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (1, 'Batman', '<NAME>', 20.56);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (2, 'Superman', '<NAME>', 50.30);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (3, 'Aquaman', '<NAME>', 23.50);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (4, 'Wonder Woman', '<NAME>', 12.67);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (5, 'Flash', '<NAME>', 5.89);");
        $db->query("INSERT INTO heroes(id, name, alter, power) VALUES (6, 'Green Lantern', 'Hal Jordan', 12.12);");
    }

    public function buildDatabase(): Database
    {
        return new Database(Configuration::getDatabaseConfiguration());
    }
}
{'fraction_non_alphanumeric': 0.1782866489470456, 'fraction_numerical': 0.02371703128194643, 'mean_word_length': 3.848364717542121, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 60, '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': '7571258', 'n_tokens_mistral': 1590, 'n_tokens_neox': 1465, 'n_words': 451}