Clean up calls to extension_loaded('json') in tests

These are no longer needed after https://wiki.php.net/rfc/always_enable_json

Closes GH-5637
This commit is contained in:
Tyson Andre 2020-05-28 12:53:12 -04:00
parent 784f1b5c49
commit 32a1ebbd43
85 changed files with 8 additions and 194 deletions

View File

@ -1,9 +1,5 @@
--TEST--
Behavior of union type checks (strict)
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip requires json');
?>
--FILE--
<?php

View File

@ -1,9 +1,5 @@
--TEST--
Behavior of union type checks (weak)
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip requires json');
?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
json_decode() tests
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
json_encode() tests
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
json_encode() & endless loop - 1
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
json_encode() & endless loop - 2
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
json_encode() & endless loop - 3
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
json_encode() & extended encoding
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$a = array('<foo>', "'bar'", '"baz"', '&blong&');

View File

@ -1,7 +1,5 @@
--TEST--
json_last_error() tests
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_decode("[1]"));

View File

@ -1,7 +1,5 @@
--TEST--
json_decode() with large integers
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$json = '{"largenum":123456789012345678901234567890}';

View File

@ -1,7 +1,5 @@
--TEST--
json_encode() with non-packed array that should be encoded as an array rather than object
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$a = array(1, 2, 3, 'foo' => 'bar');

View File

@ -2,8 +2,6 @@
Bug #40503 (json_encode() value corruption on 32bit systems with overflown values)
--INI--
serialize_precision=-1
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
function json_test_show_eq($x, $y) {

View File

@ -1,7 +1,5 @@
--TEST--
Bug #41034 (json_encode() ignores null byte started keys in arrays)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
echo json_encode(array(0, "\0ab"=>1, "\0null-prefixed value"));

View File

@ -1,7 +1,5 @@
--TEST--
Bug #41067 (json_encode() problem with UTF-16 input)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$single_barline = "\360\235\204\200";

View File

@ -2,7 +2,6 @@
Bug #41403 (json_decode cannot decode floats if localeconv decimal_point is not '.')
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
if (setlocale(LC_NUMERIC, "de_DE") === false) {
die("skip no de_DE locale");
}

View File

@ -1,7 +1,5 @@
--TEST--
Bug #41504 (json_decode() converts empty array keys to "_empty_")
--SKIPIF--
<?php if (!extension_loaded('json')) print 'skip'; ?>
--FILE--
<?php

View File

@ -2,8 +2,6 @@
Bug #41567 (json_encode() double conversion is inconsistent with PHP)
--INI--
serialize_precision=-1
--SKIPIF--
<?php if (!extension_loaded('json')) print 'skip'; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #42090 (json_decode causes segmentation fault)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(

View File

@ -4,7 +4,6 @@ Bug #42785 (Incorrect formatting of double values with non-english locales)
serialize_precision=-1
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
if (!setlocale(LC_CTYPE, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1", "ISO8859-1")) {
die("skip locale needed for this test is not supported on this platform");
}

View File

@ -1,7 +1,5 @@
--TEST--
Bug #43941 (json_encode() invalid UTF-8)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #45791 (json_decode() does not handle number 0e0)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #46215 (json_encode mutates its parameter and has some class-specific state)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #46944 (json_encode() doesn't handle 3 byte utf8 correctly)
--SKIPIF--
<?php if (!extension_loaded('json')) print 'skip'; ?>
--FILE--
<?php

View File

@ -2,7 +2,6 @@
Bug #47644 (valid large integers are truncated)
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--

View File

@ -2,8 +2,6 @@
bug #50224 (json_encode() does not always encode a float as a float)
--INI--
serialize_precision=-1
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
echo "* Testing JSON output\n\n";

View File

@ -1,7 +1,5 @@
--TEST--
bug #53946 (json_encode() with JSON_UNESCAPED_UNICODE)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_encode("latin 1234 -/ russian мама мыла раму specialchars \x02 \x08 \n U+1D11E >𝄞<"));

View File

@ -1,7 +1,5 @@
--TEST--
Bug #54058 (json_last_error() invalid UTF-8 produces wrong error)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #54484 (Empty string in json_decode doesn't reset json_last_error)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
json_decode('{"test":"test"}');

View File

@ -1,7 +1,5 @@
--TEST--
Bug #55543 (json_encode() with JSON_NUMERIC_CHECK & numeric string properties)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$a = new stdClass;

View File

@ -1,7 +1,5 @@
--TEST--
Bug #61537 (json_encode() incorrectly truncates/discards information)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$invalid_utf8 = "\x9f";

View File

@ -1,7 +1,5 @@
--TEST--
Bug #61978 (Object recursion not detected for classes that implement JsonSerializable)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #62010 (json_decode produces invalid byte-sequences)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
FR #62369 (Segfault on json_encode(deeply_nested_array)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #63737 (json_decode does not properly decode with options parameter)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
function decode($json) {

View File

@ -1,7 +1,5 @@
--TEST--
Bug #64695 JSON_NUMERIC_CHECK has issues with strings that are numbers plus the letter e
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$t = array('test' => '123343e871700');

View File

@ -1,7 +1,5 @@
--TEST--
Whitespace part of bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly")
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
function decode($json) {

View File

@ -1,7 +1,5 @@
--TEST--
Case-sensitivity part of bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly")
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
function decode($json) {

View File

@ -1,7 +1,5 @@
--TEST--
Bug #66021 (Blank line inside empty array/object when JSON_PRETTY_PRINT is set)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,9 +1,5 @@
--TEST--
Bug #66025 (Indent wrong when json_encode() called from jsonSerialize function)
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php

View File

@ -1,10 +1,5 @@
--TEST--
Bug #68546 (json_decode() Fatal error: Cannot access property started with '\0')
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #68567 JSON_PARTIAL_OUTPUT_ON_ERROR can result in JSON with null key
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #68817 (Null pointer deference)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #68938 (json_decode() decodes empty string without indicating error)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
json_decode("");

View File

@ -1,9 +1,5 @@
--TEST--
Bug #68992 (json_encode stacks exceptions thrown by JsonSerializable classes)
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #69187 json_last_error return BC in PHP7
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_decode(NULL));

View File

@ -1,7 +1,5 @@
--TEST--
Bug #71835 (json_encode sometimes incorrectly detects recursion with JsonSerializable)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
class SomeClass implements JsonSerializable {

View File

@ -1,7 +1,5 @@
--TEST--
Bug #72069 (Behavior \JsonSerializable different from json_encode)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,6 @@
--TEST--
Bug #72787 (json_decode reads out of bounds)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php

View File

@ -1,8 +1,6 @@
--TEST--
Bug #73113 (Segfault with throwing JsonSerializable)
Also test that the custom exception is not wrapped by ext/json
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,9 +1,5 @@
--TEST--
Bug #73254 (Incorrect indentation generated by json_encode() with JSON_PRETTY_PRINT)
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Allow JSON_OBJECT_AS_ARRAY to have an effect
--SKIPIF--
<?php if(!extension_loaded('json')) die('skip json extension not loaded') ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #77843: Use after free with json serializer
--SKIPIF--
<?php if(!extension_loaded('json')) die('skip json extension not loaded') ?>
--FILE--
<?php

View File

@ -1,9 +1,5 @@
--TEST--
JSON (http://www.crockford.com/JSON/JSON_checker/test/fail*.json)
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
An error is thrown when INF or NaN are encoded
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Test json_decode() function : basic functionality
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
echo "*** Testing json_decode() : basic functionality ***\n";

View File

@ -1,7 +1,5 @@
--TEST--
Test json_decode() function : error conditions
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
echo "*** Testing json_decode() : error conditions ***\n";

View File

@ -1,7 +1,5 @@
--TEST--
Test json_decode() function : JSON_THROW_ON_ERROR flag
--SKIPIF--
<?php if(!extension_loaded('json')) die('skip json extension not loaded') ?>
--FILE--
<?php

View File

@ -1,9 +1,5 @@
--TEST--
json_decode() invalid UTF8
--SKIPIF--
<?php
if (!extension_loaded("json")) print "skip";
?>
--FILE--
<?php
function json_decode_invalid_utf8($str) {

View File

@ -1,7 +1,5 @@
--TEST--
Test json_encode() function : basic functionality
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
echo "*** Testing json_encode() : basic functionality ***\n";

View File

@ -1,7 +1,5 @@
--TEST--
Test json_encode() function : basic functionality with UTF8 string input
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
echo "*** Testing json_encode() : basic functionality with UTF-8 input***\n";

View File

@ -1,7 +1,5 @@
--TEST--
Test json_encode() function : JSON_THROW_ON_ERROR flag
--SKIPIF--
<?php if(!extension_loaded('json')) die('skip json extension not loaded') ?>
--FILE--
<?php

View File

@ -1,9 +1,5 @@
--TEST--
json_encode() invalid UTF8
--SKIPIF--
<?php
if (!extension_loaded("json")) print "skip";
?>
--FILE--
<?php
function json_encode_invalid_utf8($str) {

View File

@ -2,8 +2,6 @@
Test json_encode() function with numeric flag
--INI--
serialize_precision=-1
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(

View File

@ -1,7 +1,5 @@
--TEST--
json_encode() with JSON_PRETTY_PRINT
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
function encode_decode($json) {

View File

@ -1,7 +1,5 @@
--TEST--
json_encode() tests for U+2028, U+2029
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_encode(array("a\xC3\xA1b")));

View File

@ -1,7 +1,5 @@
--TEST--
json_decode() tests
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_encode('a/b'));

View File

@ -1,7 +1,5 @@
--TEST--
JSON_THROW_ON_ERROR: global error flag untouched
--SKIPIF--
<?php if(!extension_loaded('json')) die('skip json extension not loaded') ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
json_last_error() failures
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
json_last_error_msg() failures
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -2,10 +2,6 @@
JSON (http://www.crockford.com/JSON/JSON_checker/test/pass1.json)
--INI--
serialize_precision=-1
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip json extension not loaded');
?>
--FILE--
<?php
/* Modified to test unescaped UNICODE as keys and values.
@ -78,7 +74,7 @@ $test = "
,\"rosebud\"]
";
echo 'Testing: ' . $test . "\n";
echo 'Testing:' . $test . "\n";
echo "DECODE: AS OBJECT\n";
$obj = json_decode($test);
var_dump($obj);
@ -102,7 +98,7 @@ var_dump($arr);
?>
--EXPECTF--
Testing:
Testing:
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},

View File

@ -4,7 +4,6 @@ JSON (http://www.crockford.com/JSON/JSON_checker/test/pass1.json)
serialize_precision=-1
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
@ -79,7 +78,7 @@ $test = "
,\"rosebud\"]
";
echo 'Testing: ' . $test . "\n";
echo 'Testing:' . $test . "\n";
echo "DECODE: AS OBJECT\n";
$obj = json_decode($test);
var_dump($obj);
@ -103,7 +102,7 @@ var_dump($arr);
?>
--EXPECTF--
Testing:
Testing:
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},

View File

@ -2,10 +2,6 @@
JSON (http://www.crockford.com/JSON/JSON_checker/test/pass1.json)
--INI--
serialize_precision=-1
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php
@ -68,7 +64,7 @@ $test = "
,\"rosebud\"]
";
echo 'Testing: ' . $test . "\n";
echo 'Testing:' . $test . "\n";
echo "DECODE: AS OBJECT\n";
$obj = json_decode($test);
var_dump($obj);
@ -92,7 +88,7 @@ var_dump($arr);
?>
--EXPECT--
Testing:
Testing:
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},

View File

@ -1,7 +1,5 @@
--TEST--
JSON (http://www.crockford.com/JSON/JSON_checker/test/pass2.json)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
JSON (http://www.crockford.com/JSON/JSON_checker/test/pass3.json)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
@ -14,7 +12,7 @@ $test = '
}
';
echo 'Testing: ' . $test . "\n";
echo 'Testing:' . $test . "\n";
echo "DECODE: AS OBJECT\n";
$obj = json_decode($test);
var_dump($obj);
@ -38,7 +36,7 @@ var_dump($arr);
?>
--EXPECTF--
Testing:
Testing:
{
"JSON Test Pattern pass3": {
"The outermost value": "must be an object or array.",

View File

@ -2,8 +2,6 @@
json_encode() Serialization tests
--INI--
serialize_precision=-1
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
An error is thrown when an unsupported type is encoded
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

View File

@ -2,7 +2,6 @@
Edge-cases in constant conditional jump elimination
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) die("skip for machines with 64-bit longs"); ?>
<?php if (!extension_loaded("json")) print "skip"; ?>
<?php require_once('skipif.inc'); ?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Bug #79241: Segmentation fault on preg_match()
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip json extension missing"; ?>
--FILE--
<?php

View File

@ -3,7 +3,6 @@ PDO PgSQL Bug #66584 (Segmentation fault on statement deallocation)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
if (!extension_loaded('json')) die('skip json ext not loaded');
require __DIR__ . '/config.inc';
require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();

View File

@ -3,7 +3,6 @@ Request #71855 (PDO placeholder escaping, part 2)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
if (!extension_loaded('json')) die('skip json extension not available');
require_once dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
require_once dirname(__FILE__) . '/config.inc';
PDOTest::skip();

View File

@ -2,7 +2,6 @@
Bug #66084 simplexml_load_string() mangles empty node name, json variant
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip simplexml not available"; ?>
<?php if (!extension_loaded("json")) print "skip json not available"; ?>
--FILE--
<?php
echo json_encode(simplexml_load_string('<a><b/><c><x/></c></a>')->c), "\n";

View File

@ -1,9 +1,5 @@
--TEST--
Test is_callable() function : usage variations - undefined functions
--SKIPIF--
<?php
if (!extension_loaded('json')) die("skip requires ext/json");
?>
--FILE--
<?php
/* Prototype: bool is_callable ( mixed $var [, bool $syntax_only [, string &$callable_name]] );

View File

@ -11,10 +11,6 @@ if (!setlocale
die("skip - locale needed for this test is not supported on this platform");
}
if (!extension_loaded("json")) {
print "skip - test requires the json extension";
}
?>
--FILE--
<?php

View File

@ -1,7 +1,5 @@
--TEST--
Test base64_decode() function : basic functionality - padding and whitespace
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
/* Prototype : proto string base64_decode(string str[, bool strict])