0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-04 03:57:28 +00:00
nextcloud_server/apps/settings/tests/SetupChecks/CheckServerResponseTraitImplementation.php
Ferdinand Thiessen 27300ac6ce
fix(setup-checks): Ensure URL with webroot works
We basically mock the way `URLGenerator::getAbsoluteURL` works,
so we must make sure that the URL might already contain the webroot.
Because `baseURL` and `cliURL` also contain the webroot we need to remove
the webroot from the URL first.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Daniel <mail@danielkesselberg.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-15 21:40:27 +02:00

40 lines
1,002 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Settings\Tests\SetupChecks;
use OCA\Settings\SetupChecks\CheckServerResponseTrait;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
use Psr\Log\LoggerInterface;
/**
* Dummy implementation for CheckServerResponseTraitTest
*/
class CheckServerResponseTraitImplementation {
use CheckServerResponseTrait {
CheckServerResponseTrait::getRequestOptions as public;
CheckServerResponseTrait::runHEAD as public;
CheckServerResponseTrait::runRequest as public;
CheckServerResponseTrait::normalizeUrl as public;
CheckServerResponseTrait::getTestUrls as public;
}
public function __construct(
protected IL10N $l10n,
protected IConfig $config,
protected IURLGenerator $urlGenerator,
protected IClientService $clientService,
protected LoggerInterface $logger,
) {
}
}