From 8d090438b659b641dd0f6cbc99193f3b48b2fc4b Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 7 Oct 2019 21:59:40 +0200 Subject: Validation rules: min/max/between: Use string length to compare strings --- tests/Unit/Http/Validation/Rules/MinTest.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/Unit/Http/Validation/Rules/MinTest.php (limited to 'tests/Unit/Http/Validation/Rules/MinTest.php') diff --git a/tests/Unit/Http/Validation/Rules/MinTest.php b/tests/Unit/Http/Validation/Rules/MinTest.php new file mode 100644 index 00000000..56350802 --- /dev/null +++ b/tests/Unit/Http/Validation/Rules/MinTest.php @@ -0,0 +1,26 @@ +assertFalse($rule->validate(1)); + $this->assertFalse($rule->validate('2')); + $this->assertTrue($rule->validate(3)); + $this->assertFalse($rule->validate('AS')); + $this->assertTrue($rule->validate('TEST')); + + $rule = new Min('2042-01-01'); + $this->assertFalse($rule->validate('2000-01-01')); + $this->assertTrue($rule->validate('2345-01-01')); + } +} -- cgit v1.2.3-70-g09d2