rename info tests
[m6w6/ext-http] / tests / encstream003.phpt
1 --TEST--
2 encoding stream chunked error
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9 echo "Test\n";
10
11 $s = "3\nis \nbetter than\n1\n";
12 var_dump(http\Encoding\Stream\Dechunk::decode($s));
13 $s = "3\r\nis \r\nbetter than\r\n1\r\n";
14 var_dump(http\Encoding\Stream\Dechunk::decode($s));
15 $s = "3\nis \nreally better than\n1\n";
16 var_dump(http\Encoding\Stream\Dechunk::decode($s));
17 ?>
18 DONE
19 --EXPECTF--
20 Test
21
22 Warning: http\Encoding\Stream\Dechunk::decode(): Expected LF at pos 8 of 20 but got 0x74 in %s on line %d
23
24 Warning: http\Encoding\Stream\Dechunk::decode(): Truncated message: chunk size 190 exceeds remaining data size 11 at pos 9 of 20 in %s on line %d
25 string(14) "is ter than
26 1
27 "
28
29 Warning: http\Encoding\Stream\Dechunk::decode(): Expected CRLF at pos 10 of 24 but got 0x74 0x74 in %s on line %d
30
31 Warning: http\Encoding\Stream\Dechunk::decode(): Truncated message: chunk size 190 exceeds remaining data size 12 at pos 12 of 24 in %s on line %d
32 string(15) "is er than
33 1
34 "
35
36 Warning: http\Encoding\Stream\Dechunk::decode(): Expected chunk size at pos 6 of 27 but got trash in %s on line %d
37 bool(false)
38 DONE