/** * {@inheritdoc} */ public function validate($input) { if ($input instanceof SplFileInfo) { return parent::validate($input->getSize()); } if (!is_string($input)) { return false; } return parent::validate(filesize($input)); }
/** * @dataProvider providerInvalid * @expectedException Respect\Validation\Exceptions\BetweenException */ public function testValuesOutBoundsShouldRaiseException($min, $max, $inclusive, $input) { $o = new Between($min, $max, $inclusive); $this->assertFalse($o->__invoke($input)); $this->assertFalse($o->assert($input)); }
/** * @dataProvider providerInvalid * @expectedException Respect\Validation\Exceptions\BetweenException */ public function test_values_out_bounds_should_raise_exception($min, $max, $inclusive, $input) { $o = new Between($min, $max, $inclusive); $this->assertFalse($o->validate($input)); $this->assertFalse($o->assert($input)); }