mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-02 09:38:32 +01:00
34 lines
664 B
PHP
34 lines
664 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Str;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Str;
|
|
|
|
final class LengthTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideData
|
|
*/
|
|
public function testLength(int $expected, string $str): void
|
|
{
|
|
static::assertSame($expected, Str\length($str));
|
|
}
|
|
|
|
public function provideData(): array
|
|
{
|
|
return [
|
|
[6, 'azjezz'],
|
|
[4, 'تونس'],
|
|
[3, 'سيف'],
|
|
[7, 'こんにちは世界'],
|
|
[3, '🥇🥈🥉'],
|
|
[2, '你好'],
|
|
[6, 'สวัสดี'],
|
|
[3, 'ؤخى']
|
|
];
|
|
}
|
|
}
|