/** * @expectedException \CatLab\Requirements\Exceptions\PropertyValidationException */ public function testNumberInvalid() { $property = new MockProperty(); $property->setType(\CatLab\Requirements\Enums\PropertyType::NUMBER); $property->getRequirements()->validate($property, 'abc'); $property->getRequirements()->validate($property, null); }
/** * @expectedException \CatLab\Requirements\Exceptions\PropertyValidationException */ public function testMaxValueInvalid() { $numericProperty = new MockProperty(); $numericProperty->setType(\CatLab\Requirements\Enums\PropertyType::INTEGER); $numericProperty->max(100); $numericProperty->getRequirements()->validate($numericProperty, 101); }