<commit_before><?php

use Aozisik\Outport\Outport;

class OutportTest extends TestCase
{
    public function testItMigratesDataCorrectly()
    {
        $outport = new Outport();
    }
}
<commit_msg>added a functional test<commit_after><?php

use Aozisik\Outport\Outport;

class OutportTest extends TestCase
{
    public function testItMigratesDataCorrectly()
    {
        $books = [
            [
                'title' => 'Pride and Prejudice',
                'author' => '<NAME>'
            ],
            [
                'title' => 'Oliver Twist',
                'author' => '<NAME>'
            ],
            [
                'title' => 'The Fault in Our Stars',
                'author' => '<NAME>'
            ]
        ];

        $path = (new Outport())->table('books', collect($books))->go();
        $this->assertFileExists($path);

        Config::set('database.connections.outport-test', [
            'driver' => 'sqlite',
            'database' => $path,
            'prefix' => '',
        ]);

        $readFromSQLite = DB::connection('outport-test')
            ->table('books')
            ->select('title', 'author')
            ->get()
            ->map(function ($item) {
                return (array)$item;
            })->toArray();

        $this->assertEquals($books, $readFromSQLite);
        unlink($path);
    }
}

{'fraction_non_alphanumeric': 0.15594974131559497, 'fraction_numerical': 0.0, 'mean_word_length': 1.6342412451361867, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 24, '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': '4587676', 'n_tokens_mistral': 398, 'n_tokens_neox': 386, 'n_words': 71}