diff options
Diffstat (limited to 'libs/jsonrpc/tests/Validator/JsonFormatValidatorTest.php')
-rw-r--r-- | libs/jsonrpc/tests/Validator/JsonFormatValidatorTest.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/jsonrpc/tests/Validator/JsonFormatValidatorTest.php b/libs/jsonrpc/tests/Validator/JsonFormatValidatorTest.php new file mode 100644 index 00000000..a838ada9 --- /dev/null +++ b/libs/jsonrpc/tests/Validator/JsonFormatValidatorTest.php @@ -0,0 +1,19 @@ +<?php + +use JsonRPC\Validator\JsonFormatValidator; + +require_once __DIR__.'/../../../../vendor/autoload.php'; + +class JsonFormatValidatorTest extends PHPUnit_Framework_TestCase +{ + public function testJsonParsedCorrectly() + { + $this->assertNull(JsonFormatValidator::validate(array('foobar'))); + } + + public function testJsonNotParsedCorrectly() + { + $this->setExpectedException('\JsonRPC\Exception\InvalidJsonFormatException'); + JsonFormatValidator::validate(''); + } +} |