Beispiel #1
0
 /**
  * Ensures that setImageHeight() returns expected value
  *
  * @return void
  */
 public function testSetImageHeight()
 {
     $validator = new File\ImageSize(array('minWidth' => 100, 'minHeight' => 1000, 'maxWidth' => 10000, 'maxHeight' => 100000));
     $validator->setImageHeight(array('minHeight' => 2000, 'maxHeight' => 2200));
     $this->assertEquals(array('minHeight' => 2000, 'maxHeight' => 2200), $validator->getImageHeight());
     $this->setExpectedException('Zend\\Validator\\Exception\\InvalidArgumentException', 'less than or equal');
     $validator->setImageHeight(array('minHeight' => 20000, 'maxHeight' => 200));
 }
Beispiel #2
0
 /**
  * Ensures that setImageHeight() returns expected value
  *
  * @return void
  */
 public function testSetImageHeight()
 {
     $validator = new File\ImageSize(array('minwidth' => 100, 'minheight' => 1000, 'maxwidth' => 10000, 'maxheight' => 100000));
     $validator->setImageHeight(array('minheight' => 2000, 'maxheight' => 2200));
     $this->assertEquals(array('minheight' => 2000, 'maxheight' => 2200), $validator->getImageHeight());
     try {
         $validator->setImageHeight(array('minheight' => 20000, 'maxheight' => 200));
         $this->fail("Missing exception");
     } catch (Validator\Exception $e) {
         $this->assertContains("less than or equal", $e->getMessage());
     }
 }