summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-12-19 15:58:46 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-12-19 15:58:46 +0100
commit9b26c4a27705ebbf8b6f6842f75af3f2e0608939 (patch)
tree5c000a2b216db773bd5a16edf0d6234d4c8fcc06 /apps
parentf5b833845c0c183d1ef9b8d41282bbceda45e0a7 (diff)
downloadnextcloud-server-9b26c4a27705ebbf8b6f6842f75af3f2e0608939.tar.gz
nextcloud-server-9b26c4a27705ebbf8b6f6842f75af3f2e0608939.zip
Fix PHP error on PHP >= 8.2 about dynamic property use in tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/oauth2/tests/Controller/OauthApiControllerTest.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/oauth2/tests/Controller/OauthApiControllerTest.php b/apps/oauth2/tests/Controller/OauthApiControllerTest.php
index 24385e785e5..8977f6a2b66 100644
--- a/apps/oauth2/tests/Controller/OauthApiControllerTest.php
+++ b/apps/oauth2/tests/Controller/OauthApiControllerTest.php
@@ -45,6 +45,11 @@ use OCP\Security\ICrypto;
use OCP\Security\ISecureRandom;
use Test\TestCase;
+/* We have to use this to add a property to the mocked request and avoid warnings about dynamic properties on PHP>=8.2 */
+abstract class RequestMock implements IRequest {
+ public array $server = [];
+}
+
class OauthApiControllerTest extends TestCase {
/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
private $request;
@@ -68,7 +73,7 @@ class OauthApiControllerTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- $this->request = $this->createMock(IRequest::class);
+ $this->request = $this->createMock(RequestMock::class);
$this->crypto = $this->createMock(ICrypto::class);
$this->accessTokenMapper = $this->createMock(AccessTokenMapper::class);
$this->clientMapper = $this->createMock(ClientMapper::class);