diff --git a/src/JsonSchema/Constraints/Format.php b/src/JsonSchema/Constraints/Format.php index 9262d6b..9bcab3e 100644 --- a/src/JsonSchema/Constraints/Format.php +++ b/src/JsonSchema/Constraints/Format.php @@ -92,6 +92,7 @@ class Format extends Constraint break; case 'ip-address': + case 'ipv4': if (null === filter_var($element, FILTER_VALIDATE_IP, FILTER_NULL_ON_FAILURE | FILTER_FLAG_IPV4)) { $this->addError($path, "Invalid IP address"); } @@ -104,6 +105,7 @@ class Format extends Constraint break; case 'host-name': + case 'hostname': if (!$this->validateHostname($element)) { $this->addError($path, "Invalid hostname"); } diff --git a/tests/JsonSchema/Tests/Drafts/Draft4Test.php b/tests/JsonSchema/Tests/Drafts/Draft4Test.php new file mode 100644 index 0000000..e51e06a --- /dev/null +++ b/tests/JsonSchema/Tests/Drafts/Draft4Test.php @@ -0,0 +1,36 @@ +relativeTestsRoot . '/draft4'), + realpath(__DIR__ . $this->relativeTestsRoot . '/draft4/optional') + ); + } + + protected function getSkippedTests() + { + return array( + // Not Yet Implemented + 'allOf.json', + 'anyOf.json', + 'definitions.json', + 'maxProperties.json', + 'minProperties.json', + 'multipleOf.json', + 'not.json', + 'oneOf.json', + // Partially Implemented + 'ref.json', + 'refRemote.json', + // Optional + 'bignum.json', + 'zeroTerminatedFloats.json' + ); + } + +} \ No newline at end of file