Skip to content

Commit

Permalink
Fix test portability
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Apr 24, 2018
1 parent ee76a5a commit 4371af3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ext/iconv/tests/bug76249.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequen
$fh = fopen('php://memory', 'rw');
fwrite($fh, "abc");
rewind($fh);
stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, []);
if (false === @stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, [])) {
stream_filter_append($fh, 'convert.iconv.ucs-2/utf-8//IGNORE', STREAM_FILTER_READ, []);
}
$a = stream_get_contents($fh);
var_dump(strlen($a));
?>
DONE
--EXPECTF--
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf%A8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
int(3)
DONE

0 comments on commit 4371af3

Please sign in to comment.