1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 19:52:20 +02:00
Files
archived-php-src/ext/libxml/tests/004.phpt
Christoph M. Becker ac282a90f1 Add skip reasons
2019-09-22 19:14:30 +02:00

52 lines
1.2 KiB
PHP

--TEST--
libxml_set_streams_context()
--SKIPIF--
<?php if (!extension_loaded('dom')) die('skip dom extension not available'); ?>
--FILE--
<?php
$ctxs = array(
NULL,
'bogus',
123,
new stdclass,
array('a'),
stream_context_create(),
stream_context_create(array('file')),
stream_context_create(array('file' => array('some_opt' => 'aaa')))
);
foreach ($ctxs as $ctx) {
try {
var_dump(libxml_set_streams_context($ctx));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
$dom = new DOMDocument();
var_dump($dom->load(__DIR__.'/test.xml'));
}
echo "Done\n";
?>
--EXPECTF--
Warning: stream_context_create(): options should have the form ["wrappername"]["optionname"] = $value in %s004.php on line %d
libxml_set_streams_context() expects parameter 1 to be resource, null given
bool(true)
libxml_set_streams_context() expects parameter 1 to be resource, string given
bool(true)
libxml_set_streams_context() expects parameter 1 to be resource, int given
bool(true)
libxml_set_streams_context() expects parameter 1 to be resource, object given
bool(true)
libxml_set_streams_context() expects parameter 1 to be resource, array given
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
Done