Tweaked tests for assoc array tests

This commit is contained in:
Warnar Boekkooi 2016-06-28 12:23:29 +02:00
parent 9d8a082093
commit dd5717a760
5 changed files with 52 additions and 12 deletions

View File

@ -9,8 +9,6 @@
namespace JsonSchema\Tests\Constraints;
use JsonSchema\Validator;
class AdditionalPropertiesTest extends BaseTestCase
{
public function getInvalidTests()
@ -52,8 +50,7 @@ class AdditionalPropertiesTest extends BaseTestCase
"prop":{"type":"string"}
},
"additionalProperties": false
}',
Validator::CHECK_MODE_TYPE_CAST
}'
),
array(
'{
@ -79,8 +76,7 @@ class AdditionalPropertiesTest extends BaseTestCase
"prop":{"type":"string"}
},
"additionalProperties": {"type":"string"}
}',
Validator::CHECK_MODE_TYPE_CAST
}'
),
array(
'{
@ -132,8 +128,7 @@ class AdditionalPropertiesTest extends BaseTestCase
"properties":{
"prop":{"type":"string"}
}
}',
Validator::CHECK_MODE_TYPE_CAST
}'
),
array(
'{

View File

@ -7,8 +7,6 @@
*/
namespace JsonSchema\Tests\Constraints;
use JsonSchema\Validator;
/**
* Class OfPropertiesTest
*/
@ -71,7 +69,7 @@ class OfPropertiesTest extends BaseTestCase
},
"required": ["prop1"]
}',
Validator::CHECK_MODE_NORMAL,
null,
array(
array(
"property" => "prop2",

View File

@ -9,6 +9,7 @@
namespace JsonSchema\Tests\Constraints;
use JsonSchema\Constraints\Constraint;
use JsonSchema\Constraints\UndefinedConstraint;
class RequiredPropertyTest extends BaseTestCase
@ -229,7 +230,8 @@ class RequiredPropertyTest extends BaseTestCase
"properties": {
"array":{"type":"array", "required": true}
}
}'
}',
Constraint::CHECK_MODE_NORMAL
),
array(
'{

View File

@ -8,6 +8,7 @@
*/
namespace JsonSchema\Tests\Drafts;
use JsonSchema\Constraints\Constraint;
/**
* @package JsonSchema\Tests\Drafts
@ -25,6 +26,28 @@ class Draft3Test extends BaseDraftTestCase
);
}
public function getInvalidForAssocTests()
{
$tests = parent::getInvalidForAssocTests();
unset(
$tests['type.json / object type matches objects / an array is not an object'],
$tests['type.json / array type matches arrays / an object is not an array']
);
return $tests;
}
public function getValidForAssocTests()
{
$tests = parent::getValidForAssocTests();
unset(
$tests['type.json / object type matches objects / an array is not an object'],
$tests['type.json / array type matches arrays / an object is not an array']
);
return $tests;
}
/**
* {@inheritdoc}
*/

View File

@ -25,6 +25,28 @@ class Draft4Test extends BaseDraftTestCase
);
}
public function getInvalidForAssocTests()
{
$tests = parent::getInvalidForAssocTests();
unset(
$tests['type.json / object type matches objects / an array is not an object'],
$tests['type.json / array type matches arrays / an object is not an array']
);
return $tests;
}
public function getValidForAssocTests()
{
$tests = parent::getValidForAssocTests();
unset(
$tests['type.json / object type matches objects / an array is not an object'],
$tests['type.json / array type matches arrays / an object is not an array']
);
return $tests;
}
/**
* {@inheritdoc}
*/