Annotation of embedaddon/php/ext/libxml/tests/004.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: libxml_set_streams_context()
3: --SKIPIF--
4: <?php if (!extension_loaded('dom')) die('skip'); ?>
5: --FILE--
6: <?php
7:
8: $ctxs = array(
9: NULL,
10: 'bogus',
11: 123,
12: new stdclass,
13: array('a'),
14: stream_context_create(),
15: stream_context_create(array('file')),
16: stream_context_create(array('file' => array('some_opt' => 'aaa')))
17: );
18:
19:
20: foreach ($ctxs as $ctx) {
21: var_dump(libxml_set_streams_context($ctx));
22: $dom = new DOMDocument();
23: var_dump($dom->load(dirname(__FILE__).'/test.xml'));
24: }
25:
26: echo "Done\n";
27:
28: ?>
29: --EXPECTF--
1.1.1.2 ! misho 30: Warning: stream_context_create(): options should have the form ["wrappername"]["optionname"] = $value in %s004.php on line %d
1.1 misho 31:
1.1.1.2 ! misho 32: Warning: libxml_set_streams_context() expects parameter 1 to be resource, null given in %s004.php on line %d
1.1 misho 33: NULL
34: bool(true)
35:
1.1.1.2 ! misho 36: Warning: libxml_set_streams_context() expects parameter 1 to be resource, string given in %s004.php on line %d
1.1 misho 37: NULL
1.1.1.2 ! misho 38: bool(true)
1.1 misho 39:
1.1.1.2 ! misho 40: Warning: libxml_set_streams_context() expects parameter 1 to be resource, integer given in %s004.php on line %d
! 41: NULL
1.1 misho 42: bool(true)
1.1.1.2 ! misho 43:
! 44: Warning: libxml_set_streams_context() expects parameter 1 to be resource, object given in %s004.php on line %d
1.1 misho 45: NULL
1.1.1.2 ! misho 46: bool(true)
1.1 misho 47:
1.1.1.2 ! misho 48: Warning: libxml_set_streams_context() expects parameter 1 to be resource, array given in %s004.php on line %d
! 49: NULL
1.1 misho 50: bool(true)
51: NULL
52: bool(true)
53: NULL
54: bool(true)
55: NULL
56: bool(true)
57: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>