[ExceptionHandlerFirst::class, ExceptionHandlerSecond::class]], function () { TestRouter::group(['exceptionHandler' => ExceptionHandlerThird::class], function () { TestRouter::get('/my-path', 'DummyController@method1'); }); }); try { TestRouter::debug('/my-non-existing-path', 'get'); } catch(\ResponseException $e) { } $expectedStack = [ ExceptionHandlerFirst::class, ExceptionHandlerSecond::class, ExceptionHandlerThird::class, ]; $this->assertEquals($expectedStack, $stack); } }