Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'remove-tests-catch-fail' of https://github.com/Maks3w/zf2
Browse files Browse the repository at this point in the history
… into hotfix/tests-exceptions
  • Loading branch information
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions test/JsonXmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,16 +558,12 @@ public function testNestingDepthIsHandledProperlyWhenNestingDepthExceedsMaximum(
* @dataProvider providerNestingDepthIsHandledProperly
*/
public function testNestingDepthIsHandledProperlyWhenNestingDepthDoesNotExceedMaximum($xmlStringContents)
{
try {
Json\Json::$maxRecursionDepthAllowed = 25;
$jsonString = Json\Json::fromXml($xmlStringContents, true);
$jsonArray = Json\Json::decode($jsonString, Json\Json::TYPE_ARRAY);
$this->assertNotNull($jsonArray, "JSON decode result is NULL");
$this->assertSame('A', $jsonArray['response']['message_type']['defaults']['close_rules']['after_responses']);
} catch ( Zend\Json\Exception\RecursionException $ex ) {
$this->fail('Zend_Json::fromXml does not implement recursion check properly');
}
{
Json\Json::$maxRecursionDepthAllowed = 25;
$jsonString = Json\Json::fromXml($xmlStringContents, true);
$jsonArray = Json\Json::decode($jsonString, Json\Json::TYPE_ARRAY);
$this->assertNotNull($jsonArray, "JSON decode result is NULL");
$this->assertSame('A', $jsonArray['response']['message_type']['defaults']['close_rules']['after_responses']);
}

/**
Expand Down

0 comments on commit 2056187

Please sign in to comment.