Skip to content

Commit

Permalink
Tweaked tests for assoc array tests
Browse files Browse the repository at this point in the history
  • Loading branch information
boekkooi-fresh committed Jun 28, 2016
1 parent efc9124 commit d3115a4
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 12 deletions.
11 changes: 3 additions & 8 deletions tests/Constraints/AdditionalPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

namespace JsonSchema\Tests\Constraints;

use JsonSchema\Validator;

class AdditionalPropertiesTest extends BaseTestCase
{
public function getInvalidTests()
Expand Down Expand Up @@ -52,8 +50,7 @@ public function getInvalidTests()
"prop":{"type":"string"}
},
"additionalProperties": false
}',
Validator::CHECK_MODE_TYPE_CAST
}'
),
array(
'{
Expand All @@ -79,8 +76,7 @@ public function getInvalidTests()
"prop":{"type":"string"}
},
"additionalProperties": {"type":"string"}
}',
Validator::CHECK_MODE_TYPE_CAST
}'
),
array(
'{
Expand Down Expand Up @@ -132,8 +128,7 @@ public function getValidTests()
"properties":{
"prop":{"type":"string"}
}
}',
Validator::CHECK_MODE_TYPE_CAST
}'
),
array(
'{
Expand Down
4 changes: 1 addition & 3 deletions tests/Constraints/OfPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
*/
namespace JsonSchema\Tests\Constraints;

use JsonSchema\Validator;

/**
* Class OfPropertiesTest
*/
Expand Down Expand Up @@ -71,7 +69,7 @@ public function getInvalidTests()
},
"required": ["prop1"]
}',
Validator::CHECK_MODE_NORMAL,
null,
array(
array(
"property" => "prop2",
Expand Down
4 changes: 3 additions & 1 deletion tests/Constraints/RequiredPropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace JsonSchema\Tests\Constraints;

use JsonSchema\Constraints\Constraint;
use JsonSchema\Constraints\UndefinedConstraint;

class RequiredPropertyTest extends BaseTestCase
Expand Down Expand Up @@ -229,7 +230,8 @@ public function getInvalidTests()
"properties": {
"array":{"type":"array", "required": true}
}
}'
}',
Constraint::CHECK_MODE_NORMAL
),
array(
'{
Expand Down
23 changes: 23 additions & 0 deletions tests/Drafts/Draft3Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

namespace JsonSchema\Tests\Drafts;
use JsonSchema\Constraints\Constraint;

/**
* @package JsonSchema\Tests\Drafts
Expand All @@ -25,6 +26,28 @@ protected function getFilePaths()
);
}

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}
*/
Expand Down
22 changes: 22 additions & 0 deletions tests/Drafts/Draft4Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,28 @@ protected function getFilePaths()
);
}

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}
*/
Expand Down

0 comments on commit d3115a4

Please sign in to comment.