Repository navigation
Pre-release 4.2.112 → 4.2.111 — task 2.17 step 1: v13 TestResponse from call() - #84
Merged
Merged
Conversation
agissept
force-pushed
the
pre-release/4.2.112
branch
from
September 30, 2026 10:37
dad83f7 to
1f0d48e
Compare
agissept
marked this pull request as ready for review
October 1, 2026 07:35
Require illuminate/testing ^13 and wrap the response of the test client in Illuminate\Testing\TestResponse. call() (and callSecure(), action(), route(), which go through it) keep their L4.2 signature, so existing tests run unchanged: - TestResponse forwards unknown methods and properties to the real response (getContent(), getStatusCode(), headers, original, ...); - the L4.2 assertions (assertResponseOk, assertRedirectedTo, ...) still read $this->client->getResponse(). Tests can now use the v13 fluent assertions on what call() returns ($this->get($uri)->assertOk()->assertJsonPath(...)), so the app can move its ~500 test files over in batches before the legacy assertions are removed. What breaks is code that treats the result as a Symfony response: a Response type hint or an assertInstanceOf on it (use ->baseResponse). illuminate/testing v13 depends only on components already on v13. Its assertions run on PHPUnit 9.6, which the fork and the app still use; tests/Foundation/FoundationTestingResponseTest covers the wrapping, the legacy assertions, a failing fluent assertion, the JSON, redirect, session and streamed-response assertions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo
agissept
force-pushed
the
pre-release/4.2.112
branch
from
October 1, 2026 08:39
1f0d48e to
209fe9a
Compare
agissept
approved these changes
Oct 1, 2026
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.
Task 2.17, step 1 — v13
TestResponsefromcall()(illuminate/testing v13)Stacks on #83. Adds
illuminate/testing: ^13and makes the testing trait'scall()return anIlluminate\Testing\TestResponsewrapped around the client's response.callSecure(),action()androute()go throughcall(), so they return one too.Why a first step: 2.17 moves about 500 app test files from the L4.2 assertions to v13's fluent ones, which is too big for one reviewable PR. This step makes the fluent assertions available on today's
call()without breaking the old ones. The app can then migrate in batches, and a later step removes the legacy assertions.What stays the same
call()signature,($method, $uri, $parameters, $files, $server, $content, $changeHistory). v13'scall()takes$cookiesfourth, so switching now would silently send files as cookies. It changes at the foundation flip (4.5).assertResponseOk,assertResponseStatus,assertRedirectedTo/ToRoute/ToAction,assertViewHas,assertSessionHas*,assertHasOldInput) still read$this->client->getResponse().TestResponseforwards unknown methods and properties to the real response (getContent(),getStatusCode(),headers,original,getTargetUrl(), …).What changes for callers
Response. AResponsetype hint on it fails, and so doesassertInstanceOf(XResponse::class, $response). Type-hintTestResponse, and use$response->baseResponsefor instance checks. The app pair fixes the 8 files that do this.$response['key']now reads JSON or view data (TestResponseimplementsArrayAccess), andTestResponsehas no__toString().PHPUnit
illuminate/testingv13 suggests PHPUnit 11.5 or 12.5; the fork and the app run 9.6.TestResponseonly usesAssert,ConstraintandExpectationFailedException, which 9.6 has, and the new test runs the commonly used assertions on 9.6.Tests
tests/Foundation/FoundationTestingResponseTesthas 6 tests:call()wraps the client's response and passes its arguments through unchanged;call()turns 5 of the 6 red.Verification
composer validateOK;composer.json(with rector) resolvesilluminate/testingv13.34.0;feature/platform/framework-4.2.112-rc1), with vendor installed exactly from its lock and the local SMTP sink on127.0.0.1:1025:TechnicalProblemMailerBoringTest,FatalErrorNotificationTest,InviteDevelopersTest) andBeanstalkdQueueBoringTestagainst a real worker: green.$this->get/post/…calls, 64 directcall()s and 22ajaxPost()s all go through the newcall(). 5 failures, the same 5 as the 4.2.111 pair in the same setup: three learning-notes views that get a null date, one tutorial-graduation expectation, and one upload-size check.RateLimitBoringTest(changed, outside the suites) passes its first 9 assertions and then errors on the last request, after a 61-second sleep. It errors identically on 4.2.111, so the problem is its timing and existed before this change.Asia/Jakartatimezone andmax_connections).Rest of 2.17
assertRedirectedToRoute583,assertResponseOk378,assertResponseStatus244,assertSessionHas226,assertRedirectedTo146,assertViewHas14, others 3.ci/check-console-handle.sh) can keep the count from growing.call()signature at 4.5.Tag
4.2.112ondad83f75is not pushed; tag pushes are refused for this session.🤖 Generated with Claude Code
https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo