Return to bug64166_3.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / streams |
1.1 misho 1: --TEST-- 2: Bug #64166: quoted-printable-encode stream filter incorrectly discarding whitespace - writes 3: --FILE-- 4: <?php 5: 6: function test_64166($data) { 7: $fd = fopen('php://temp', 'w+'); 8: $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_WRITE, array( 9: 'line-break-chars' => "\n", 10: 'line-length' => 74 11: )); 12: fwrite($fd, $data); 13: rewind($fd); 14: 15: var_dump(stream_get_contents($fd, -1, 0)); 16: 17: stream_filter_remove($res); 18: 19: rewind($fd); 20: stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_WRITE, array( 21: 'line-break-chars' => "\n", 22: 'line-length' => 6 23: )); 24: fwrite($fd, $data); 25: rewind($fd); 26: var_dump(stream_get_contents($fd, -1, 0)); 27: 28: fclose($fd); 29: } 30: 31: test_64166("FIRST \nSECOND"); 32: test_64166("FIRST \nSECOND"); 33: 34: ?> 35: --EXPECT-- 36: string(15) "FIRST=20 37: SECOND" 38: string(19) "FIRST= 39: =20 40: SECON= 41: D" 42: string(18) "FIRST=20=20 43: SECOND" 44: string(24) "FIRST= 45: =20= 46: =20 47: SECON= 48: D"