Testing: ServeTest POST form via phpc serve (#248) - #345
Merged
Conversation
ServeTest and ServeAotTest now assert urlencoded POST bodies reach $_POST via phpc serve and phpc serve --aot. DevServer readRequest parses bodies without requiring a trailing newline. HashTable::rehash() linked collision chains correctly so populating eight $_SERVER keys no longer hangs on CONTENT_LENGTH (VM serve POST was timing out). Closes #248. Also covers #281 (AOT 404 status) and #285 (AOT POST form). Co-authored-by: Cursor <cursoragent@cursor.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ServeTest::testPostFormUrlencodedprovingphpc servepopulates$_POSTfromapplication/x-www-form-urlencodedbodies.ServeAotTest::testServeAotPostFormUrlencodedandtestServeAotHttpResponseCode404SetsStatusLinefor the AOT serve path.HashTable::rehash()collision chaining (VM serve hung after ~8$_SERVERkeys whenCONTENT_LENGTHwas set).DevServer::readRequest()to delimit headers via\r\n\r\nand read bodies byContent-Length.Test plan
php vendor/bin/phpunit test/real/ServeTest.php(19 tests) inphp-compiler:22.04-devServeAotTest(filter) in DockerHashTableTest::testAddManyStringKeysIncludingContentLengthDevServerHeadersTest::testReadRequestPostBodyWithoutTrailingNewlineCloses #248. Also closes #281 and #285.
Made with Cursor