Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.7] Create getter for the http middleware groups #26268

Merged
merged 1 commit into from
Oct 26, 2018
Merged

[5.7] Create getter for the http middleware groups #26268

merged 1 commit into from
Oct 26, 2018

Commits on Oct 26, 2018

  1. Create getter for the http middleware groups

    This getter allows to create tests for the route middleware groups,
    which is currently not possible because the property is protected.
    
    For example, if you want to ensure that the web group is using a
    middleware to track utm campaigns, with this getter you can write:
    
    ```php
    /** @test */
    public function it_registers_the_track_utm_middleware_in_the_web_group()
    {
        $groups = resolve(\App\Http\Kernel::class)->getMiddlewareGroups();
    
        $this->assertContains(\App\Http\Middleware\TrackUTM::class, $groups['web']);
    }
    ```
    roberto-aguilar committed Oct 26, 2018
    Configuration menu
    Copy the full SHA
    07648ae View commit details
    Browse the repository at this point in the history