Repository navigation
refactor(tests): build the e2e client on utopia-php/client - #261
Merged
Merged
Conversation
utopia-php/fetch is archived and was only kept as a dev dependency for this client, which Edge also reuses for its executor E2E suite. The client keeps its public surface (call(), setKey() and the METHOD_* constants) and fetch's request semantics: no Accept header added, http_build_query encoding for GET parameters, JSON or form bodies by content type, up to 5 redirects followed, a 5s connect timeout, lowercased response headers with the last value of a repeated header winning.
Two scenarios post their params as multipart/form-data. fetch handed the flattened params to curl, which built the form and added the boundary to the content type; the client now builds the same form with the psr7 factory and keeps its boundary-carrying content type.
TorstenDittmann
approved these changes
Oct 7, 2026
30 of 34 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
utopia-php/fetchis archived. The executor's own code already usesutopia-php/client ^0.6, andfetchwas left only as a dev dependency fortests/e2e/Client.php. That class extendsUtopia\Fetch\Client, and appwrite-labs/edge reuses it (throughvendor/open-runtimes/executor/tests/e2e) for its executor E2E suite. Edge has to keepfetchtoo until this changes.This rewrites the test client on
utopia-php/client(cURL adapter) and dropsutopia-php/fetchfromrequire-dev. The lock loses onlyutopia-php/fetch 1.1.2.The public surface is unchanged, because Edge's
K8sExecutorClientextends this class and usesself::METHOD_POST:__construct(string $endpoint, array $baseHeaders = []),setKey().call(...)with the same signature and return shape (headerswith lowercased names plusstatus-code,body).METHOD_GET/POST/PUT/PATCH/DELETE/HEAD/OPTIONSconstants. They are now declared here instead of inherited, and the values are the same strings.fetch's request semantics are kept on purpose, since several tests depend on them:
Acceptheader is added. The accept-header tests send their own, and psr7'sjson()helper would have addedapplication/json, so the body is built withjson_encodedirectly.http_build_query's default encoding (+for spaces), as fetch did, not psr7's RFC 3986query().parent[child]fields withnullas an empty field, as fetch handed them to curl, and the request carries the factory'smultipart/form-data; boundary=…content type, which libcurl used to add. An unknown content type with a non-empty body throws instead of guessing.$timeoutargument stays in milliseconds.$callback, chunks are streamed throughClient::stream()andbodyisnull.One wire difference: the client asks for compressed responses (
Accept-Encoding) and decodes them. fetch sent noAccept-Encoding. Bodies come back identical. On a compressed response,content-encodingandcontent-lengthare dropped from the returned headers. No test here or in Edge asserts on them, and the executor doesn't compress its responses.Part of appwrite/appwrite#13828. Once this is released, Edge bumps to it and drops
fetchentirely.Tests
composer format:check,composer analyze,composer refactor:checkandcomposer test:unit(37 tests) all pass.[];trueas1andnullas an empty field;Accept: */*(curl's default) left untouched;call()sites, including multipart responses and log streaming) runs in CI.