19declare(strict_types=1);
23use PHPUnit\Framework\TestCase;
24use PHPUnit\Framework\Attributes\Test;
25use PHPUnit\Framework\Attributes\Small;
26use Psr\Http\Message\ServerRequestInterface;
27use Psr\Http\Message\UriInterface;
34 private function buildRequest(
string $path, array $query_params = []): ServerRequestInterface
36 $uri = $this->createStub(UriInterface::class);
37 $uri->method(
'getPath')->willReturn(
$path);
39 $request = $this->createStub(ServerRequestInterface::class);
40 $request->method(
'getUri')->willReturn($uri);
41 $request->method(
'getQueryParams')->willReturn($query_params);
64 $this->
buildRequest(
'/webdav.php/default/ref_92/sub/file.txt')
67 $this->assertSame(
'ref_92/sub/file.txt', $translation->getRequestedPath());
78 $this->assertSame(
'ref_92/sub/file.txt', $translation->getRequestedPath());
89 $this->assertSame(
'', $translation->getRequestedPath());
101 $this->assertSame(
'ref_92', $translation->getRequestedPath());
109 $this->
buildRequest(
'/webdav.php/ref_92/folder/file.txt')
113 [
'ref_92',
'folder',
'file.txt'],
114 $translation->getRequestedPathAsArray()
126 $this->assertSame(
'/webdav.php/default/', $translation->getBasePath());
137 $this->assertSame(
'/webdav.php/', $translation->getBasePath());
148 $this->assertSame(
'/webdav.php/', $translation->getBasePath());
156 $this->
buildRequest(
'/webdav.php/ref_92', [
'mount-instructions' =>
''])
159 $this->assertTrue($translation->showMountPoint());
170 $this->assertFalse($translation->showMountPoint());
getRequestedPath_withoutClientSegment_isReturnedAsIs()
getBasePath_emptyClientId_excludesClientCheck()
buildConfig(string $client_id='default')
getRequestedPath_endpointOnly_returnsEmpty()
showMountPoint_queryParamPresent_returnsTrue()
buildRequest(string $path, array $query_params=[])
getRequestedPathAsArray_splitsOnSlashes()
getBasePath_withClientSegment_includesClientId()
showMountPoint_queryParamMissing_returnsFalse()
getBasePath_withoutClientSegment_excludesClientId()
getRequestedPath_withClientSegment_isStripped()
getRequestedPath_clientLooksLikeRef_isNotStripped()
__construct()
Constructor setup ILIAS global object @access public.