forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed bug #54440: libxml extension ignores default context.
- Loading branch information
1 parent
f2cfb99
commit 047ed8d
Showing
3 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--TEST-- | ||
Bug #54440: libxml extension ignores default context | ||
--SKIPIF-- | ||
<?php if (!extension_loaded('simplexml')) die('skip simplexml required for this test'); ?> | ||
--FILE-- | ||
<?php | ||
|
||
class TestWrapper { | ||
|
||
function stream_open($path, $mode, $options, &$opened_path) | ||
{ | ||
if ($this->context) | ||
print_r(stream_context_get_options($this->context)); | ||
return false; | ||
} | ||
|
||
function url_stat($path, $flags) | ||
{ | ||
return array(); | ||
} | ||
|
||
} | ||
|
||
stream_wrapper_register("test", "TestWrapper") | ||
or die("Failed to register protocol"); | ||
|
||
$ctx1 = stream_context_create(array('test'=>array('test'=>'test 1'))); | ||
$ctx2 = stream_context_create(array('test'=>array('test'=>'test 2'))); | ||
|
||
stream_context_set_default(stream_context_get_options($ctx1)); | ||
@simplexml_load_file('test://sdfsdf'); | ||
|
||
libxml_set_streams_context($ctx2); | ||
@simplexml_load_file('test://sdfsdf'); | ||
--EXPECT-- | ||
Array | ||
( | ||
[test] => Array | ||
( | ||
[test] => test 1 | ||
) | ||
|
||
) | ||
Array | ||
( | ||
[test] => Array | ||
( | ||
[test] => test 2 | ||
) | ||
|
||
) |