com php-src: Add tests for json_last_error()/json_las t_error_msg() failures: ext/json/tests/json_las t_error_error.phpt
ext/json/tests/json_last_error _msg_error.phpt

From: Date: Mon, 20 Jul 2015 23:50:40 +0000
Subject: com php-src: Add tests for json_last_error()/json_las t_error_msg() failures: ext/json/tests/json_las t_error_error.phpt
ext/json/tests/json_last_error _msg_error.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-88078@lists.php.net to get a copy of this message
Commit: f18ba0f9c96bc344f010304ea07299cbdfb851ef Author: Kubo2 <kelerest123@gmail.com> Mon, 20 Jul 2015 13:05:44 +0200 Committer: Christoph M. Becker <cmb@php.net> Tue, 21 Jul 2015 01:50:40 +0200 Parents: e3a85074edd2f92ca167e0b5c6be5c4633198686 Branches: PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f18ba0f9c96bc344f010304ea07299cbdfb851ef Log: Add tests for json_last_error()/json_last_error_msg() failures Changed paths: A ext/json/tests/json_last_error_error.phpt A ext/json/tests/json_last_error_msg_error.phpt Diff: diff --git a/ext/json/tests/json_last_error_error.phpt b/ext/json/tests/json_last_error_error.phpt new file mode 100644 index 0000000..bb00388 --- /dev/null +++ b/ext/json/tests/json_last_error_error.phpt @@ -0,0 +1,22 @@ +--TEST-- +json_last_error() failures +--SKIPIF-- +<?php !extension_loaded('json') && die('skip json extension not available') ?> +--FILE-- +<?php + +var_dump(json_last_error()); +var_dump(json_last_error(TRUE)); +var_dump(json_last_error('some', 4, 'args', 'here')); + + +?> +--EXPECTF-- +int(0) + +Warning: json_last_error() expects exactly 0 parameters, 1 given in %s on line %d +NULL + +Warning: json_last_error() expects exactly 0 parameters, 4 given in %s on line %d +NULL + diff --git a/ext/json/tests/json_last_error_msg_error.phpt b/ext/json/tests/json_last_error_msg_error.phpt new file mode 100644 index 0000000..8135cf1 --- /dev/null +++ b/ext/json/tests/json_last_error_msg_error.phpt @@ -0,0 +1,21 @@ +--TEST-- +json_last_error_msg() failures +--SKIPIF-- +<?php !extension_loaded('json') && die('skip json extension not available') ?> +--FILE-- +<?php + +var_dump(json_last_error_msg()); +var_dump(json_last_error_msg(TRUE)); +var_dump(json_last_error_msg('some', 4, 'args', 'here')); + +?> +--EXPECTF-- +string(8) "No error" + +Warning: json_last_error_msg() expects exactly 0 parameters, 1 given in %s on line %d +NULL + +Warning: json_last_error_msg() expects exactly 0 parameters, 4 given in %s on line %d +NULL +

« previous php.cvs (#88078) next »