for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Hogosha\Monitor\Validator;
/**
* @author Guillaume Cavana <[email protected]>
*/
class JsonValidatorTest extends \PHPUnit_Framework_TestCase
{
* testCheckFalse
* @expectedException Hogosha\Monitor\Exception\ValidatorException
* @expectedExceptionMessage PropertyAccessor requires a graph of objects or arrays to operate on, but it found type "string" while trying to traverse path "name.toto" at property "toto".
public function testException()
$htmlValidator = new JsonValidator();
$htmlValidator->check('{"name": "Chuck Norris"}', 'name.toto');
}
* @expectedExceptionMessage This json is not valid
public function testInvalidJson()
$htmlValidator->check('{"name": "Chuck Norris"', 'name.toto');