endtoend-test-psl/tests/Psl/Str/PadRightTest.php
2019-12-27 05:42:24 +01:00

30 lines
656 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
namespace Psl\Tests\Str;
use PHPUnit\Framework\TestCase;
use Psl\Str;
class PadRightTest extends TestCase
{
/**
* @dataProvider provideData
*/
public function testPadRight(string $expected, string $str, int $total_length, string $pad_string = ' '): void
{
self::assertSame($expected, Str\pad_right($str, $total_length, $pad_string));
}
public function provideData(): array
{
return [
['aaay ', 'aaay', 5],
['aaayy', 'aaay', 5, 'y'],
['Yeet', 'Yee', 4, 't'],
['مرحباااا', 'مرحبا', 8, 'ا'],
];
}
}