Skip to content

Commit

Permalink
revert forcing middleware uniqueness (#13075)
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid authored and taylorotwell committed Apr 7, 2016
1 parent 3d95b03 commit b18c01e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ public function middleware($middleware = null)
$middleware = [$middleware];
}

$this->action['middleware'] = array_unique(array_merge(
$this->action['middleware'] = array_merge(
(array) Arr::get($this->action, 'middleware', []), $middleware
));
);

return $this;
}
Expand Down
14 changes: 0 additions & 14 deletions tests/Routing/RoutingRouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,20 +575,6 @@ public function testRouteMiddlewareMergeWithMiddlewareAttributesAsStrings()
);
}

public function testRouteMiddlewareAppliedOnlyOnce()
{
$router = $this->getRouter();
$router->group(['middleware' => 'foo'], function () use ($router) {
$router->get('bar', function () { return 'hello'; })->middleware(['foo', 'foo']);
});
$routes = $router->getRoutes()->getRoutes();
$route = $routes[0];
$this->assertEquals(
['foo'],
$route->middleware()
);
}

public function testRoutePrefixing()
{
/*
Expand Down

0 comments on commit b18c01e

Please sign in to comment.