Skip to content

Conversation

@jackbayliss
Copy link
Contributor

@jackbayliss jackbayliss commented Nov 19, 2025

I'm using WithCachedRoutes in my test case - I have a test where I check various permissions, the routes in my web.php are flagged, depending on the feature so I need to make sure the test is refreshed as older cached routes don't have the permissions I'm checking.

I'd like the ability to do the below in my test - without the need for a new test case etc:

    public function setUp(): void
    {
        // We ensure each test has freshly cached routes due to testing feature based permissions below.
        CachedState::$cachedRoutes = null;

        parent::setUp();
    }

I've adjusted both properties to allow for null to keep them inline. There could probably be further adjustments to allow for methods to do this like withoutCachedRoutes for better dx, but for now I just want to do it myself.

Dont think it's a breaking change, but open to feedback - cheers 👍🏻

@github-actions
Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@jackbayliss
Copy link
Contributor Author

Failing tests look to be cURL error 28: SSL connection timeout issues, so not related.

@jackbayliss jackbayliss marked this pull request as ready for review November 19, 2025 16:43
@taylorotwell taylorotwell merged commit ed28602 into laravel:12.x Nov 19, 2025
53 of 68 checks passed
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.

2 participants