createAndSetUpAppWithConfig([]); $app->get('config')->set('tshirt_sizes', [ 'S' => 'Small Straight-Cut', 'M' => 'Medium Straight-Cut', ]); $this->subject = new ShirtSize(); } /** * @return array */ public function provideTestValidateData(): array { return [ 'empty string' => ['', false], 'null' => [null, false], '0' => [0, false], '"S" (known value)' => ['S', true], '"M" (known value)' => ['M', true], '"L" (unknown value)' => ['L', false], ]; } /** * @covers \Engelsystem\Http\Validation\Rules\ShirtSize::__construct * @dataProvider provideTestValidateData */ public function testValidate(mixed $value, bool $expectedValid): void { self::assertSame($expectedValid, $this->subject->validate($value)); } }