Browse Source

Adding more tests for imageSize() validation.

Florian Krämer 9 years ago
parent
commit
760ff6d0ac
1 changed files with 20 additions and 0 deletions
  1. 20 0
      tests/TestCase/Validation/ValidationTest.php

+ 20 - 0
tests/TestCase/Validation/ValidationTest.php

@@ -2834,6 +2834,26 @@ class ValidationTest extends TestCase
             'width' => ['==', 100],
             'height' => ['==', 300],
         ]));
+
+        $this->assertTrue(Validation::imageSize($upload, [
+            'width' => ['>=', 300],
+            'height' => ['>=', 300],
+        ]));
+
+        $this->assertTrue(Validation::imageSize($upload, [
+            'width' => ['<=', 300],
+            'height' => ['<=', 300],
+        ]));
+
+        $this->assertTrue(Validation::imageSize($upload, [
+            'width' => ['<=', 300],
+            'height' => ['>=', 300],
+        ]));
+
+        $this->assertFalse(Validation::imageSize($upload, [
+            'width' => ['<=', 299],
+            'height' => ['>=', 300],
+        ]));
     }
 
     /**