summaryrefslogtreecommitdiff
path: root/tests/Unit/Http/Validation/Rules/MaxTest.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2019-10-13 13:43:08 +0200
committermsquare <msquare@notrademark.de>2019-10-13 13:43:08 +0200
commitc0e97bfe753013b115345b00cbfd9858799a6ac9 (patch)
tree7e98447e4c7d874ec27e26801771086843f3efc3 /tests/Unit/Http/Validation/Rules/MaxTest.php
parent285f5509dd948c2359c861eec364a677e8ce4910 (diff)
parent7a2427e70296ef652f76fe2e2edc47d2e0f70f5a (diff)
Password recovery rebuild, correctly translated Mails and some minor fixes #658
Diffstat (limited to 'tests/Unit/Http/Validation/Rules/MaxTest.php')
-rw-r--r--tests/Unit/Http/Validation/Rules/MaxTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Unit/Http/Validation/Rules/MaxTest.php b/tests/Unit/Http/Validation/Rules/MaxTest.php
new file mode 100644
index 00000000..3f4d9516
--- /dev/null
+++ b/tests/Unit/Http/Validation/Rules/MaxTest.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Http\Validation\Rules;
+
+use Engelsystem\Http\Validation\Rules\Max;
+use Engelsystem\Test\Unit\TestCase;
+
+class MaxTest extends TestCase
+{
+ /**
+ * @covers \Engelsystem\Http\Validation\Rules\Max
+ */
+ public function testValidate()
+ {
+ $rule = new Max(3);
+ $this->assertFalse($rule->validate(10));
+ $this->assertFalse($rule->validate('22'));
+ $this->assertTrue($rule->validate(3));
+ $this->assertFalse($rule->validate('TEST'));
+ $this->assertTrue($rule->validate('AS'));
+
+ $rule = new Max('2042-01-01');
+ $this->assertFalse($rule->validate('2100-01-01'));
+ $this->assertTrue($rule->validate('2000-01-01'));
+ }
+}