/** * Checks whether or not converted method has valid data. * @param annotation EndpointMethod method docObj was derived from * @param docObj object Method object to validate * @param methodName string Name of method to validate * @throws Exceptions\InvalidAnnotationException */ public function validateAndFormatMethod(EndpointMethod $annotation, &$docObj, $methodName) { if (!HttpMethodValidator::isValidMethod($docObj->HTTPMethod)) { throw new Exceptions\InvalidAnnotationException($annotation, $methodName, '@HTTPMethod must be a valid method (GET, POST, PUT, DELETE...)'); } else { $docObj->HTTPMethod = strtoupper($docObj->HTTPMethod); } }
public function testIncorrect() { foreach (self::$badMethods as $method) { $this->assertFalse(HttpMethodValidator::isValidMethod($method)); } }