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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Illuminate/Foundation/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,14 @@ public function getApplication()
{
return $this->app;
}

/**
* Get the application's route middleware groups.
*
* @return array
*/
public function getMiddlewareGroups()
{
return $this->middlewareGroups;
}
}
35 changes: 35 additions & 0 deletions tests/Foundation/Http/KernelTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Illuminate\Tests\Foundation\Http;

use Illuminate\Routing\Router;
use PHPUnit\Framework\TestCase;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Http\Kernel;

class KernelTest extends TestCase
{
public function testGetMiddlewareGroups()
{
$kernel = new Kernel($this->getApplication(), $this->getRouter());

$this->assertEquals([], $kernel->getMiddlewareGroups());
}

/**
* @return \Illuminate\Foundation\Application
*/
protected function getApplication()
{
return new Application;
}

/**
* @return \Illuminate\Routing\Router
*/
protected function getRouter()
{
return new Router(new Dispatcher);
}
}