getMockForAbstractClass( ContainerInterface::class ) ); $authority = $params['authority'] ?? $this->mockAnonUltimateAuthority(); $config = ( $params['config'] ?? [] ) + [ MainConfigNames::CanonicalServer => 'https://wiki.example.com', MainConfigNames::InternalServer => 'http://api.local:8080', MainConfigNames::RestPath => '/rest' ]; $request = $params['request'] ?? new RequestData(); return new Router( $params['routeFiles'] ?? [ MW_INSTALL_PATH . '/tests/phpunit/unit/includes/Rest/testRoutes.json' ], $params['extraRoutes'] ?? [], $params['options'] ?? new ServiceOptions( Router::CONSTRUCTOR_OPTIONS, $config ), $params['cacheBag'] ?? new \EmptyBagOStuff(), $params['responseFactory'] ?? new ResponseFactory( [] ), $params['basicAuth'] ?? new StaticBasicAuthorizer(), $params['authority'] ?? $authority, $params['objectFactory'] ?? $objectFactory, $params['validator'] ?? new Validator( $objectFactory, $request, $authority ), $params['errorReporter'] ?? new PHPErrorReporter(), $params['hookContainer'] ?? $this->createHookContainer(), $params['session'] ?? $this->getSession() ); } }