2020 *
2121 */
2222
23+ namespace TestHelpers \Unit ;
24+
25+ use PHPUnit ;
2326use TestHelpers \WebDavHelper ;
2427use GuzzleHttp \Client ;
2528use GuzzleHttp \Handler \MockHandler ;
@@ -61,7 +64,7 @@ public function setUp(): void {
6164 * @return void
6265 * @throws \GuzzleHttp\Exception\GuzzleException
6366 */
64- public function testUrlIsSanitizedByMakeDavRequestForNewerDav ():void {
67+ public function testUrlIsSanitizedByMakeDavRequestForNewerDav (): void {
6568 WebDavHelper::makeDavRequest (
6669 'http://own.cloud///core ' ,
6770 'user1 ' ,
@@ -99,7 +102,7 @@ public function testUrlIsSanitizedByMakeDavRequestForNewerDav():void {
99102 * @return void
100103 * @throws \GuzzleHttp\Exception\GuzzleException
101104 */
102- public function testUrlIsSanitizedByMakeDavRequestForOlderDavPath ():void {
105+ public function testUrlIsSanitizedByMakeDavRequestForOlderDavPath (): void {
103106 WebDavHelper::makeDavRequest (
104107 'http://own.cloud///core ' ,
105108 'user1 ' ,
@@ -137,7 +140,7 @@ public function testUrlIsSanitizedByMakeDavRequestForOlderDavPath():void {
137140 * @return void
138141 * @throws \GuzzleHttp\Exception\GuzzleException
139142 */
140- public function testMakeDavRequestReplacesAsteriskAndHashesOnUrls ():void {
143+ public function testMakeDavRequestReplacesAsteriskAndHashesOnUrls (): void {
141144 WebDavHelper::makeDavRequest (
142145 'http://own.cloud///core ' ,
143146 'user1 ' ,
@@ -180,7 +183,7 @@ public function testMakeDavRequestReplacesAsteriskAndHashesOnUrls():void {
180183 * @return void
181184 * @throws \GuzzleHttp\Exception\GuzzleException
182185 */
183- public function testMakeDavRequestOnBearerAuthorization ():void {
186+ public function testMakeDavRequestOnBearerAuthorization (): void {
184187 WebDavHelper::makeDavRequest (
185188 'http://own.cloud/core ' ,
186189 'user1 ' ,
@@ -221,7 +224,7 @@ public function testMakeDavRequestOnBearerAuthorization():void {
221224 *
222225 * @return void
223226 */
224- public function testSanitizationOnDefault (?string $ unsanitizedUrl , ?string $ expectedUrl ):void {
227+ public function testSanitizationOnDefault (?string $ unsanitizedUrl , ?string $ expectedUrl ): void {
225228 $ sanitizedUrl = WebDavHelper::sanitizeUrl ($ unsanitizedUrl );
226229 $ this ->assertEquals ($ expectedUrl , $ sanitizedUrl );
227230 }
@@ -236,7 +239,7 @@ public function testSanitizationOnDefault(?string $unsanitizedUrl, ?string $expe
236239 *
237240 * @return void
238241 */
239- public function testSanitizationWhenTrailingSlashIsSetToFalse (?string $ unsanitizedUrl , ?string $ expectedUrl ):void {
242+ public function testSanitizationWhenTrailingSlashIsSetToFalse (?string $ unsanitizedUrl , ?string $ expectedUrl ): void {
240243 $ sanitizedUrl = WebDavHelper::sanitizeUrl ($ unsanitizedUrl );
241244 $ this ->assertEquals ($ expectedUrl , $ sanitizedUrl );
242245 }
@@ -251,7 +254,7 @@ public function testSanitizationWhenTrailingSlashIsSetToFalse(?string $unsanitiz
251254 *
252255 * @return void
253256 */
254- public function testSanitizationWhenTrailingSlashIsSetToTrue (?string $ unsanitizedUrl , ?string $ expectedUrl ):void {
257+ public function testSanitizationWhenTrailingSlashIsSetToTrue (?string $ unsanitizedUrl , ?string $ expectedUrl ): void {
255258 $ sanitizedUrl = WebDavHelper::sanitizeUrl ($ unsanitizedUrl , true );
256259 $ this ->assertEquals ($ expectedUrl , $ sanitizedUrl );
257260 }
@@ -261,7 +264,7 @@ public function testSanitizationWhenTrailingSlashIsSetToTrue(?string $unsanitize
261264 *
262265 * @return void
263266 */
264- public function testGetDavPathForOlderDavVersion ():void {
267+ public function testGetDavPathForOlderDavVersion (): void {
265268 $ davPath = WebDavHelper::getDavPath ('user1 ' , 1 );
266269 $ this ->assertEquals ('remote.php/webdav/ ' , $ davPath );
267270
@@ -279,7 +282,7 @@ public function testGetDavPathForOlderDavVersion():void {
279282 *
280283 * @return void
281284 */
282- public function testGetDavPathForNewerDavPath ():void {
285+ public function testGetDavPathForNewerDavPath (): void {
283286 // `type` should be `files` by default.
284287 // check that both returns same thing.
285288 $ davPath = WebDavHelper::getDavPath ('user1 ' , 2 );
@@ -295,7 +298,7 @@ public function testGetDavPathForNewerDavPath():void {
295298 *
296299 * @return void
297300 */
298- public function testGetDavPathForNewerDavPathButNotForFiles ():void {
301+ public function testGetDavPathForNewerDavPathButNotForFiles (): void {
299302 $ davPath = WebDavHelper::getDavPath ('user1 ' , 2 , null );
300303 $ this ->assertEquals ('remote.php/dav ' , $ davPath );
301304
@@ -309,7 +312,7 @@ public function testGetDavPathForNewerDavPathButNotForFiles():void {
309312 *
310313 * @return void
311314 */
312- public function testGetDavPathForInvalidVersionsShouldThrowException ():void {
315+ public function testGetDavPathForInvalidVersionsShouldThrowException (): void {
313316 $ this ->expectException (InvalidArgumentException::class);
314317 $ this ->expectExceptionMessage ("DAV path version 3 is unknown " );
315318
@@ -322,7 +325,7 @@ public function testGetDavPathForInvalidVersionsShouldThrowException():void {
322325 *
323326 * @return array
324327 */
325- public function withoutTrailingSlashUrlsProvider ():array {
328+ public function withoutTrailingSlashUrlsProvider (): array {
326329 return [
327330 ['http://own.cloud/ ' , 'http://own.cloud ' ],
328331 ['http://own.cloud//index.php ' , 'http://own.cloud/index.php ' ],
@@ -344,7 +347,7 @@ public function withoutTrailingSlashUrlsProvider():array {
344347 *
345348 * @return string[][]
346349 */
347- public function withTrailingSlashUrlsProvider ():array {
350+ public function withTrailingSlashUrlsProvider (): array {
348351 return [
349352 ['http://own.cloud/ ' , 'http://own.cloud/ ' ],
350353 ['http://own.cloud ' , 'http://own.cloud/ ' ],
0 commit comments