projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
add 7.3; reconfigure for master
[m6w6/ext-http]
/
tests
/
messageparser001.phpt
diff --git
a/tests/messageparser001.phpt
b/tests/messageparser001.phpt
index f4ec2d90967a01e42350817d1a93f8cf776f63ce..1167c64115b2d85d8ef07958dad756f36f77e017 100644
(file)
--- a/
tests/messageparser001.phpt
+++ b/
tests/messageparser001.phpt
@@
-12,6
+12,7
@@
echo "Test\n";
use http\Message\Parser;
foreach (glob(__DIR__."/data/message_*.txt") as $file) {
use http\Message\Parser;
foreach (glob(__DIR__."/data/message_*.txt") as $file) {
+ $string = "";
$parser = new Parser;
$fd = fopen($file, "r") or die("Could not open $file");
while (!feof($fd)) {
$parser = new Parser;
$fd = fopen($file, "r") or die("Could not open $file");
while (!feof($fd)) {
@@
-23,6
+24,11
@@
foreach (glob(__DIR__."/data/message_*.txt") as $file) {
throw new Exception(($e = error_get_last()) ? $e["message"] : "Could not parse $file");
}
}
throw new Exception(($e = error_get_last()) ? $e["message"] : "Could not parse $file");
}
}
+
+ if (!$string) {
+ $s = array("START", "HEADER", "HEADER_DONE", "BODY", "BODY_DUMB", "BODY_LENGTH", "BODY_CHUNK", "BODY_DONE", "UPDATE_CL", "DONE");
+ printf("Unexpected state: %s (%s)\n", $s[$parser->getState()], $file);
+ }
$parser = new Parser;
rewind($fd);
$parser = new Parser;
rewind($fd);
@@
-38,12
+44,14
@@
foreach (glob(__DIR__."/data/message_*.txt") as $file) {
if ($string !== (string) $message) {
$a = explode("\n", $string);
$b = explode("\n", (string) $message);
if ($string !== (string) $message) {
$a = explode("\n", $string);
$b = explode("\n", (string) $message);
- while ((null !== ($aa = array_shift($a))) || (null !== ($bb = array_shift($b)))) {
+ do {
+ $aa = array_shift($a);
+ $bb = array_shift($b);
if ($aa !== $bb) {
isset($aa) and printf("-- %s\n", $aa);
isset($bb) and printf("++ %s\n", $bb);
}
if ($aa !== $bb) {
isset($aa) and printf("-- %s\n", $aa);
isset($bb) and printf("++ %s\n", $bb);
}
- }
+ }
while ($a || $b);
}
}
?>
}
}
?>