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

34 lines
656 B
PHP

<?php
declare(strict_types=1);
namespace Psl\Tests\Str;
use PHPUnit\Framework\TestCase;
use Psl\Str;
class LengthTest extends TestCase
{
/**
* @dataProvider provideData
*/
public function testLength(int $expected, string $str): void
{
self::assertSame($expected, Str\length($str));
}
public function provideData(): array
{
return [
[6, 'azjezz'],
[4, 'تونس'],
[3, 'سيف'],
[7, 'こんにちは世界'],
[3, '🥇🥈🥉'],
[2, '你好'],
[6, 'สวัสดี'],
[3, 'ؤخى']
];
}
}