diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-12-20 08:45:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-20 08:45:12 +0100 |
commit | fcf5789916e914613addd7d7fe32cf50bfd614ae (patch) | |
tree | f81b769a9f186c2dcf8ad9b737533985f0407f91 /apps | |
parent | 7929e6d91d23c88b85b806e349dfca1eece898ca (diff) | |
parent | 9b26c4a27705ebbf8b6f6842f75af3f2e0608939 (diff) | |
download | nextcloud-server-fcf5789916e914613addd7d7fe32cf50bfd614ae.tar.gz nextcloud-server-fcf5789916e914613addd7d7fe32cf50bfd614ae.zip |
Merge pull request #35828 from nextcloud/fix/fix-oauth2-test-dynamic-property
Fix PHP error on PHP >= 8.2 about dynamic property use in tests
Diffstat (limited to 'apps')
-rw-r--r-- | apps/oauth2/tests/Controller/OauthApiControllerTest.php | 7 |
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); |