endtoend-test-psl/tests/Psl/Str/RepeatTest.php
2020-10-15 11:05:30 +02:00

29 lines
573 B
PHP

<?php
declare(strict_types=1);
namespace Psl\Tests\Str;
use PHPUnit\Framework\TestCase;
use Psl\Str;
final class RepeatTest extends TestCase
{
/**
* @dataProvider provideData
*/
public function testRepeat(string $expected, string $string, int $multiplier): void
{
static::assertSame($expected, Str\repeat($string, $multiplier));
}
public function provideData(): array
{
return [
['a', 'a', 1],
['Go! Go! Go! ', 'Go! ', 3],
['مممممممممممم', 'م', 12],
];
}
}