File tree 1 file changed +24
-0
lines changed
tests/src/Kernel/Controller
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,30 @@ public function testMissingToken(): void {
364
364
}
365
365
}
366
366
367
+ /**
368
+ * Tests different routes using a non-string 'token' query parameter.
369
+ *
370
+ * This can only happen if the requests comes from a source that is not
371
+ * Collabora Online, or if an unexpected change was introduced in a new
372
+ * version of Collabora Online.
373
+ *
374
+ * @covers ::wopiCheckFileInfo
375
+ * @covers ::wopiGetFile
376
+ * @covers ::wopiPutFile
377
+ */
378
+ public function testNonStringToken (): void {
379
+ $ requests = $ this ->createRequests ();
380
+ foreach ($ requests as $ name => $ request ) {
381
+ // Replace the token with a value that is not in the JWT format.
382
+ $ request ->query ->set ('access_token ' , ['not a string ' ]);
383
+ $ this ->assertAccessDeniedResponse (
384
+ 'Expected a string access token, found array. ' ,
385
+ $ request ,
386
+ $ name ,
387
+ );
388
+ }
389
+ }
390
+
367
391
/**
368
392
* Tests different routes using an invalid token.
369
393
*
You can’t perform that action at this time.
0 commit comments