Skip to content

Commit

Permalink
Merge pull request #27852 from roberto-aguilar/feature/http-kernel
Browse files Browse the repository at this point in the history
[5.8] Create getter for the http route middlewares
  • Loading branch information
taylorotwell authored Mar 11, 2019
2 parents a3bbb7f + 8412218 commit fe2c8a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Illuminate/Foundation/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,16 @@ public function getMiddlewareGroups()
return $this->middlewareGroups;
}

/**
* Get the application's route middleware.
*
* @return array
*/
public function getRouteMiddleware()
{
return $this->routeMiddleware;
}

/**
* Get the Laravel application instance.
*
Expand Down
7 changes: 7 additions & 0 deletions tests/Foundation/Http/KernelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ public function testGetMiddlewareGroups()
$this->assertEquals([], $kernel->getMiddlewareGroups());
}

public function testGetRouteMiddleware()
{
$kernel = new Kernel($this->getApplication(), $this->getRouter());

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

/**
* @return \Illuminate\Contracts\Foundation\Application
*/
Expand Down

0 comments on commit fe2c8a6

Please sign in to comment.