/** * Ensures that setMin() returns expected value * * @return void */ public function testSetMin() { $validator = new File\Count(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); }
/** * Ensures that setMin() returns expected value * * @return void */ public function testSetMin() { $validator = new File\Count(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()); } }