summaryrefslogtreecommitdiff
path: root/tests/Unit/Http/Validation/Rules/MinTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/Http/Validation/Rules/MinTest.php')
-rw-r--r--tests/Unit/Http/Validation/Rules/MinTest.php26
1 files changed, 26 insertions, 0 deletions
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 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Http\Validation\Rules;
+
+use Engelsystem\Http\Validation\Rules\Min;
+use Engelsystem\Test\Unit\TestCase;
+
+class MinTest extends TestCase
+{
+ /**
+ * @covers \Engelsystem\Http\Validation\Rules\Min
+ */
+ public function testValidate()
+ {
+ $rule = new Min(3);
+ $this->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'));
+ }
+}