Skip to content

Pre-release 4.2.116 → 4.2.115 — task 4.5 (test harness): v13 request API in ApplicationTrait - #88

Merged
agissept merged 1 commit into
masterfrom
pre-release/4.2.116
Oct 2, 2026
Merged

agissept merged 1 commit into
masterfrom
pre-release/4.2.116

Conversation

@oonid

@oonid oonid commented Sep 30, 2026 •

Copy link
Copy Markdown

Task 4.5, test harness — v13 request API in ApplicationTrait

Stacks on #87. The fork's test request methods take the signatures of v13's Foundation\Testing\Concerns\MakesHttpRequests. When the app's tests later move onto v13's Foundation TestCase, every request call will then mean the same thing it means today. Only the testing layer changes; nothing an app loads at runtime does.

Changes

  • ApplicationTrait::call($method, $uri, $parameters, $cookies, $files, $server, $content): v13's argument order. It changes in three ways:

    • $cookies comes before $files;
    • an UploadedFile inside $parameters moves to the files, as in v13's call();
    • $changeHistory goes.
  • New verbs with v13's signatures:

    • get($uri, $headers);
    • post, put, patch and delete($uri, $data, $headers).

    Headers become server variables the way v13's transformHeadersToServerVars() does it (HTTP_*, except CONTENT_TYPE and REMOTE_ADDR). get() takes no parameters.

  • Removed: callSecure(), action() and route(). v13 has none of them.

  • Client::withRequestCookies(): sends cookies with the next request only, on top of the cookie jar's. That's what call()'s $cookies does in v13.

  • Requests still go through the BrowserKit client, so the cookie jar and the last response carry over between requests as before.

  • Tests:

    • new FoundationTestingRequestsTest (5 tests) covers the argument order, the file extraction, headers on get(), data on the data verbs, and the per-request cookies;
    • FoundationTestingResponseTest's fake client follows the new request() call.

Verification

  • Fork:
    • suite 277 green on PHPUnit 11.5.56, with no deprecations, notices or warnings;
    • ratchet green, every pattern at baseline.
  • Downstream: the dicoding app pair dicoding-dev/dicoding#5967 (feature/platform/framework-4.2.116-rc1) rewrites the app's 322 affected request calls. It ran with vendor installed exactly from its lock and the local SMTP sink on 127.0.0.1:1025:
    • Psalm (full project, no cache): no errors.
    • Unit suite: 8477 green.
    • Integration suite: all 2987 tests, run per directory. There are the same 5 failures as the 4.2.115 pair, and 196 skipped, as there. No test is flagged risky.
    • Deliberately breaking a rewritten call turns its test red. The breaks tried: a bearer token moved from server: to files:, an upload moved from files: to server:, and a call('GET', $uri, $parameters) put back as get($uri, $parameters).
  • Checks ran in a cloud container without deck (PHP 8.4.26, MariaDB 10.11).

Left for the flip

v13's own call() sends the request straight to the HTTP kernel, without a BrowserKit client. The app reads the last response from the client (latestResponse()), and drives pages and forms through it (sendFormDataOnPage(), $this->client). So at the flip, the app keeps a client-based call() with this same signature. The verbs, the argument order and the call sites don't change again.

Tag

4.2.116 on e05af168 is not pushed; tag pushes are refused for this session.

🤖 Generated with Claude Code

https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo

@agissept
agissept added this pull request to stack #91 October 1, 2026 06:28
@agissept
agissept force-pushed the pre-release/4.2.116 branch 3 times, most recently from ab562fc to fe3d8f3 Compare October 1, 2026 10:40
Base automatically changed from pre-release/4.2.115 to master October 2, 2026 06:12
@agissept
agissept marked this pull request as ready for review October 2, 2026 06:48
The test request methods take the shape of v13's MakesHttpRequests,
so the app's calls mean the same thing before and after its tests move
onto v13's Foundation TestCase:

- call($method, $uri, $parameters, $cookies, $files, $server, $content):
  cookies come before files, and uploaded files in the parameters move
  to the files, as v13 does. $changeHistory goes.
- get($uri, $headers), and post/put/patch/delete($uri, $data,
  $headers), with headers sent as server variables. get() takes no
  parameters any more.
- callSecure(), action() and route() go: v13 has none of them.
- Client::withRequestCookies() sends cookies with the next request
  only, on top of the cookie jar's, which is what call()'s $cookies
  does in v13.

Requests still go through the BrowserKit client, so the cookie jar
and the last response carry over between requests as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo
@agissept
agissept force-pushed the pre-release/4.2.116 branch from fe3d8f3 to 996a469 Compare October 2, 2026 06:48
@agissept
agissept merged commit ac73f1c into master Oct 2, 2026
2 checks passed
@agissept
agissept deleted the pre-release/4.2.116 branch October 2, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants