mirror of
https://github.com/justinrainbow/json-schema.git
synced 2025-05-02 04:18:09 +02:00
Add subset of draft-04 tests from JSON-Schema-Test-Suite.
This commit is contained in:
parent
67254323e1
commit
60a0e09bc5
@ -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");
|
||||
}
|
||||
|
36
tests/JsonSchema/Tests/Drafts/Draft4Test.php
Normal file
36
tests/JsonSchema/Tests/Drafts/Draft4Test.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace JsonSchema\Tests\Drafts;
|
||||
|
||||
class Draft4Test extends BaseDraftTestCase
|
||||
{
|
||||
protected function getFilePaths()
|
||||
{
|
||||
return array(
|
||||
realpath(__DIR__ . $this->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'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user