tui/tests/Unit/MatcherTest.php
2026-08-22 17:52:17 +02:00

27 lines
818 B
PHP

<?php
namespace Myrmidex\AnagramFinder\Tests\Unit;
use Myrmidex\AnagramFinder\Matcher;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
final class MatcherTest extends TestCase
{
#[DataProvider('checkProvider')]
public function testCheck(string $anagram, string $word, bool $isExpectedMatch)
{
$this->assertEquals($isExpectedMatch, Matcher::check($anagram, $word));
}
public static function checkProvider(): array
{
return [
'valid1' => [ "eamstoxil", "steam", true ],
'valid2' => [ "wordneoxs", "downers", true ],
'valid3' => [ "ioevpmoef", "movie", true ],
'invalid_basic' => [ "eamstoxil", "smear", false],
'invalid_double_e' => [ "eamstexil", "smear", false],
];
}
}