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

33 lines
758 B
PHP

<?php
declare(strict_types=1);
namespace Psl\Tests\Str;
use PHPUnit\Framework\TestCase;
use Psl\Str;
class EndsWithTest extends TestCase
{
/**
* @dataProvider provideData
*/
public function testEndsWith(bool $expected, string $haystack, string $suffix): void
{
self::assertSame($expected, Str\ends_with($haystack, $suffix));
}
public function provideData(): array
{
return [
[false, 'Hello, World', 'world', ],
[false, 'T U N I S I A', 'e', ],
[true, 'تونس', 'س'],
[true, 'Hello, World', '', ],
[false, 'hello, world', 'hey', ],
[true, 'azjezz', 'z', ],
[true, 'مرحبا بكم', 'بكم', ],
];
}
}