* SPDX-FileContributor: Danilo Correa * SPDX-FileContributor: Gabriel Caruso * SPDX-FileContributor: Henrique Moody */ declare(strict_types=1); namespace Respect\Validation\Validators; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use Respect\Validation\Test\RuleTestCase; #[Group('validator')] #[CoversClass(StartsWith::class)] final class StartsWithTest extends RuleTestCase { /** @return iterable */ public static function providerForValidInput(): iterable { return [ [new StartsWith('foo'), ['foo', 'bar']], [new StartsWith('foo'), 'foobarbaz'], [new StartsWith('foo'), 'foobazfoo'], [new StartsWith('foo', 'bar'), 'barbaz'], [new StartsWith('foo', 'bar'), ['bar', 'baz']], [new StartsWith('1'), ['1', 2, 3]], ]; } /** @return iterable */ public static function providerForInvalidInput(): iterable { return [ [new StartsWith(123), 123], [new StartsWith('foo'), ''], [new StartsWith('bat'), ['foo', 'bar']], [new StartsWith('foo'), 'barfaabaz'], [new StartsWith('foo'), 'FOObarbaz'], [new StartsWith('foo'), 'faabarbaz'], [new StartsWith('foo'), 'baabazfaa'], [new StartsWith('foo'), 'baafoofaa'], [new StartsWith('foo', 'bar'), 'bazfoo'], [new StartsWith('foo', 'bar'), ['baz', 'foo']], [new StartsWith('1'), [1, '1', 3]], [new StartsWith('1'), [1, 2, 3]], ]; } }