getMockBuilder(Application::class) ->onlyMethods($methods) ->getMock(); } /** * Creates an Application instance with a Config set as 'config'. * Also sets up the instance as global Application instance. * * @param string[] $methods Names of the methods to mock */ protected function createAndSetUpAppWithConfig(array $methods = ['make', 'instance']): Application|MockObject { $app = $this->getApp($methods); $app->instance('config', new Config([])); Application::setInstance($app); return $app; } }