Skip to content

Commit 2b730e9

Browse files
committed
Added test to add verify single characters can be emitted
1 parent 14ea037 commit 2b730e9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/ChunkedDecoderTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,19 @@ public function testHexDecimalInBodyIsPotentialThreadSplitted()
321321
$this->input->emit('data', array("world"));
322322
}
323323

324+
public function testEmitSingleCharacter()
325+
{
326+
$this->parser->on('data', $this->expectCallableConsecutive(4, array('t', 'e', 's', 't')));
327+
$this->parser->on('close', $this->expectCallableOnce());
328+
$this->parser->on('end', $this->expectCallableOnce());
329+
$this->parser->on('error', $this->expectCallableNever());
330+
331+
$array = str_split("4\r\ntest\r\n0\r\n\r\n");
332+
333+
foreach ($array as $character) {
334+
$this->input->emit('data', array($character));
335+
}
336+
}
324337

325338
public function testHandleError()
326339
{

0 commit comments

Comments
 (0)