endtoend-test-psl/tests/Psl/Str/Byte/LengthTest.php
2020-01-02 00:00:08 +01:00

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, 'ؤخى']
];
}
}