<commit_before><?php declare(strict_types=1);

namespace Symplify\ChangelogLinker\Tests\Analyzer\IdsAnalyzer;

use PHPUnit\Framework\TestCase;
use Symplify\ChangelogLinker\Analyzer\IdsAnalyzer;

final class IdsAnalyzerTest extends TestCase
{
    /**
     * @var IdsAnalyzer
     */
    private $idsAnalyzer;

    protected function setUp(): void
    {
        $this->idsAnalyzer = new IdsAnalyzer();
    }

    public function test(): void
    {
        $content = file_get_contents(__DIR__ . '/Source/SomeFile.md');
        $this->assertSame(15, $this->idsAnalyzer->getHighestIdInChangelog($content));

        $content = file_get_contents(__DIR__ . '/Source/SomeFileWithLinks.md');
        $this->assertSame(20, $this->idsAnalyzer->getHighestIdInChangelog($content));<commit_msg>use dataProvider<commit_after><?php declare(strict_types=1);

namespace Symplify\ChangelogLinker\Tests\Analyzer\IdsAnalyzer;

use Iterator;
use PHPUnit\Framework\TestCase;
use Symplify\ChangelogLinker\Analyzer\IdsAnalyzer;

final class IdsAnalyzerTest extends TestCase
{
    /**
     * @var IdsAnalyzer
     */
    private $idsAnalyzer;

    protected function setUp(): void
    {
        $this->idsAnalyzer = new IdsAnalyzer();
    }

    /**
     * @dataProvider provideData()
     */
    public function test(string $filePath, int $expectedId): void
    {
        $content = file_get_contents($filePath);
        $this->assertSame($expectedId, $this->idsAnalyzer->getHighestIdInChangelog($content));
    }

    public function provideData(): Iterator
    {
        yield [__DIR__ . '/Source/SomeFile.md', 15];
        yield [__DIR__ . '/Source/SomeFileWithLinks.md', 20];
{'fraction_non_alphanumeric': 0.12447129909365559, 'fraction_numerical': 0.006042296072507553, 'mean_word_length': 3.574585635359116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '4155420', 'n_tokens_mistral': 534, 'n_tokens_neox': 516, 'n_words': 89}