Annotation of embedaddon/php/ext/standard/tests/streams/bug64166.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #64166: quoted-printable-encode stream filter incorrectly discarding whitespace
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: function test_64166($data) {
        !             7:     $fd = fopen('php://temp', 'w+');
        !             8:     fwrite($fd, $data);
        !             9:     rewind($fd);
        !            10: 
        !            11:     $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array(
        !            12:                'line-break-chars' => "\n",
        !            13:                'line-length' => 74
        !            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_READ, array(
        !            21:                'line-break-chars' => "\n",
        !            22:                'line-length' => 6
        !            23:     ));
        !            24:     var_dump(stream_get_contents($fd, -1, 0));
        !            25: 
        !            26:     fclose($fd);
        !            27: }
        !            28: 
        !            29: test_64166("FIRST \nSECOND");
        !            30: test_64166("FIRST  \nSECOND");
        !            31: 
        !            32: ?>
        !            33: --EXPECT--
        !            34: string(15) "FIRST=20
        !            35: SECOND"
        !            36: string(19) "FIRST=
        !            37: =20
        !            38: SECON=
        !            39: D"
        !            40: string(18) "FIRST=20=20
        !            41: SECOND"
        !            42: string(24) "FIRST=
        !            43: =20=
        !            44: =20
        !            45: SECON=
        !            46: D"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>