Skip to content

Commit

Permalink
Fix test for thrown exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker committed May 14, 2016
1 parent b3aa3fc commit 138c69d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Tests/format/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,19 @@ public function testAStringIsConvertedToADataObject()
$object2,
'The JSON string should covert into an object with sections.'
);
}

/**
* @testdox A malformed JSON string causes an Exception to be thrown
*
* @covers Joomla\Registry\Format\Json::stringToObject
* @expectedException \RuntimeException
*/
public function testAMalformedJsonStringCausesAnExceptionToBeThrown()
{
$class = new Json;

/**
* Test for bad input
* Everything that is not starting with { is handled by
* Format\Ini, which we test seperately
*/
$this->assertNull($class->stringToObject('{key:\'value\''));
$class->stringToObject('{key:\'value\'');
}

/**
Expand Down

0 comments on commit 138c69d

Please sign in to comment.