<commit_before><?php

namespace BenTools\ETL\Tests\Iterator;

use BenTools\ETL\Iterator\CsvFileIterator;
use BenTools\ETL\Tests\TestSuite;
use PHPUnit\Framework\TestCase;

class CsvFileIteratorTest extends TestCase
{

    public function testIterator()
    {
        $file     = new \SplFileObject(TestSuite::getDataFile('dictators.csv'));
        $iterator = new CsvFileIterator($file);
        $this->assertEquals([
            [
                'country',
                'name',
            ],
            [
                'USA',
                '<NAME>',
            ],
            [
                'Russia',
                '<NAME>',
            ],
        ], array_values(iterator_to_array($iterator)));
    }
}<commit_msg>Fix count() method that might not return a relevant result<commit_after><?php

namespace BenTools\ETL\Tests\Iterator;

use BenTools\ETL\Iterator\CsvFileIterator;
use BenTools\ETL\Tests\TestSuite;
use PHPUnit\Framework\TestCase;

class CsvFileIteratorTest extends TestCase
{

    public function testIterator()
    {
        $file     = new \SplFileObject(TestSuite::getDataFile('dictators.csv'));
        $iterator = new CsvFileIterator($file);
        $this->assertCount(3, $iterator);
        $this->assertEquals([
            [
                'country',
                'name',
            ],
            [
                'USA',
                '<NAME>',
            ],
            [
                'Russia',
                '<NAME>',
            ],
        ], array_values(iterator_to_array($iterator)));

    }
}
{'fraction_non_alphanumeric': 0.12242268041237113, 'fraction_numerical': 0.0006443298969072165, 'mean_word_length': 1.7055749128919862, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, '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': '2755301', 'n_tokens_mistral': 431, 'n_tokens_neox': 422, 'n_words': 71}