Skip to content

Commit

Permalink
Adding more tests for imageSize() validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Sep 19, 2016
1 parent 86e6a80 commit 760ff6d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/TestCase/Validation/ValidationTest.php
Expand Up @@ -2834,6 +2834,26 @@ public function testImageSize()
'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],
]));
}

/**
Expand Down

0 comments on commit 760ff6d

Please sign in to comment.