File tree Expand file tree Collapse file tree
src/Illuminate/Foundation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -716,7 +716,7 @@ public function forgetMiddleware($class)
716716 {
717717 $ this ->middlewares = array_filter ($ this ->middlewares , function ($ m ) use ($ class )
718718 {
719- return get_class ( $ m ['class ' ]) != $ class ;
719+ return $ m ['class ' ] != $ class ;
720720 });
721721 }
722722
Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ public function testServiceProvidersAreCorrectlyRegistered()
3838 }
3939
4040
41+ public function testForgetMiddleware ()
42+ {
43+ $ app = new ApplicationGetMiddlewaresStub ;
44+ $ app ->middleware ('Illuminate\Http\FrameGuard ' );
45+ $ app ->forgetMiddleware ('Illuminate\Http\FrameGuard ' );
46+ $ this ->assertEquals (0 , count ($ app ->getMiddlewares ()));
47+ }
48+
4149 public function testDeferredServicesMarkedAsBound ()
4250 {
4351 $ app = new Application ;
@@ -136,6 +144,14 @@ protected function setExceptionHandler(Closure $handler) { return $handler; }
136144
137145}
138146
147+ class ApplicationGetMiddlewaresStub extends Illuminate \Foundation \Application
148+ {
149+ public function getMiddlewares ()
150+ {
151+ return $ this ->middlewares ;
152+ }
153+ }
154+
139155class ApplicationDeferredSharedServiceProviderStub extends Illuminate \Support \ServiceProvider {
140156 protected $ defer = true ;
141157 public function register ()
You can’t perform that action at this time.
0 commit comments