Пример #1
0
 /**
  * Ensures that setMin() returns expected value
  *
  * @return void
  */
 public function testSetMin()
 {
     $validator = new File\WordCount(array('min' => 1000, 'max' => 10000));
     $validator->setMin(100);
     $this->assertEquals(100, $validator->getMin());
     $this->setExpectedException('Zend\\Validator\\Exception\\InvalidArgumentException', 'less than or equal');
     $validator->setMin(20000);
 }
Пример #2
0
 /**
  * Ensures that setMin() returns expected value
  *
  * @return void
  */
 public function testSetMin()
 {
     $validator = new File\WordCount(array('min' => 1000, 'max' => 10000));
     $validator->setMin(100);
     $this->assertEquals(100, $validator->getMin());
     try {
         $validator->setMin(20000);
         $this->fail("Missing exception");
     } catch (Validator\Exception $e) {
         $this->assertContains("less than or equal", $e->getMessage());
     }
 }