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