mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-12 09:09:45 +01:00
31 lines
677 B
PHP
31 lines
677 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Str;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Str;
|
|
|
|
class MetaphoneTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideData
|
|
*/
|
|
public function testMetaphone(?string $expected, string $str, int $phonemes = 0): void
|
|
{
|
|
self::assertSame($expected, Str\metaphone($str, $phonemes));
|
|
}
|
|
|
|
public function provideData(): array
|
|
{
|
|
return [
|
|
['HL', 'hello'],
|
|
['HLWRLT', 'Hello, World !!', 10],
|
|
['PPLLNKTBTSTNWLLWSFNTX0R', 'People linked by destiny will always find each other.'],
|
|
['', 'سيف'],
|
|
['', '1337'],
|
|
];
|
|
}
|
|
}
|