aboutsummaryrefslogtreecommitdiffstats
path: root/apps/oauth2
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2024-08-30 15:10:03 +0200
committerJulien Veyssier <julien-nc@posteo.net>2024-09-03 03:18:38 +0200
commitca587b1108fa6f2b9b3250d0497044771f07e963 (patch)
treee4ad85173633f626268b5efc485268e19fed7d75 /apps/oauth2
parentf226974c508b6870e836e09072ed0a9878211961 (diff)
downloadnextcloud-server-ca587b1108fa6f2b9b3250d0497044771f07e963.tar.gz
nextcloud-server-ca587b1108fa6f2b9b3250d0497044771f07e963.zip
fix(oauth2): fix tests
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'apps/oauth2')
-rw-r--r--apps/oauth2/lib/Migration/Version011901Date20240829164356.php2
-rw-r--r--apps/oauth2/tests/Controller/OauthApiControllerTest.php10
-rw-r--r--apps/oauth2/tests/Controller/SettingsControllerTest.php6
3 files changed, 9 insertions, 9 deletions
diff --git a/apps/oauth2/lib/Migration/Version011901Date20240829164356.php b/apps/oauth2/lib/Migration/Version011901Date20240829164356.php
index 9ce9ff371cb..20f5754bf11 100644
--- a/apps/oauth2/lib/Migration/Version011901Date20240829164356.php
+++ b/apps/oauth2/lib/Migration/Version011901Date20240829164356.php
@@ -23,7 +23,7 @@ class Version011901Date20240829164356 extends SimpleMigrationStep {
) {
}
- public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
+ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$qbUpdate = $this->connection->getQueryBuilder();
$qbUpdate->update('oauth2_clients')
->set('secret', $qbUpdate->createParameter('updateSecret'))
diff --git a/apps/oauth2/tests/Controller/OauthApiControllerTest.php b/apps/oauth2/tests/Controller/OauthApiControllerTest.php
index ec4826b75e8..56a49288ada 100644
--- a/apps/oauth2/tests/Controller/OauthApiControllerTest.php
+++ b/apps/oauth2/tests/Controller/OauthApiControllerTest.php
@@ -282,7 +282,7 @@ class OauthApiControllerTest extends TestCase {
$client = new Client();
$client->setClientIdentifier('clientId');
- $client->setSecret('hashedClientSecret');
+ $client->setSecret(bin2hex('hashedClientSecret'));
$this->clientMapper->method('getByUid')
->with(42)
->willReturn($client);
@@ -307,7 +307,7 @@ class OauthApiControllerTest extends TestCase {
$client = new Client();
$client->setClientIdentifier('clientId');
- $client->setSecret('hashedClientSecret');
+ $client->setSecret(bin2hex('hashedClientSecret'));
$this->clientMapper->method('getByUid')
->with(42)
->willReturn($client);
@@ -345,7 +345,7 @@ class OauthApiControllerTest extends TestCase {
$client = new Client();
$client->setClientIdentifier('clientId');
- $client->setSecret('hashedClientSecret');
+ $client->setSecret(bin2hex('hashedClientSecret'));
$this->clientMapper->method('getByUid')
->with(42)
->willReturn($client);
@@ -441,7 +441,7 @@ class OauthApiControllerTest extends TestCase {
$client = new Client();
$client->setClientIdentifier('clientId');
- $client->setSecret('hashedClientSecret');
+ $client->setSecret(bin2hex('hashedClientSecret'));
$this->clientMapper->method('getByUid')
->with(42)
->willReturn($client);
@@ -540,7 +540,7 @@ class OauthApiControllerTest extends TestCase {
$client = new Client();
$client->setClientIdentifier('clientId');
- $client->setSecret('hashedClientSecret');
+ $client->setSecret(bin2hex('hashedClientSecret'));
$this->clientMapper->method('getByUid')
->with(42)
->willReturn($client);
diff --git a/apps/oauth2/tests/Controller/SettingsControllerTest.php b/apps/oauth2/tests/Controller/SettingsControllerTest.php
index 06eca4f0fb9..0b1f0809eaa 100644
--- a/apps/oauth2/tests/Controller/SettingsControllerTest.php
+++ b/apps/oauth2/tests/Controller/SettingsControllerTest.php
@@ -108,7 +108,7 @@ class SettingsControllerTest extends TestCase {
$client = new Client();
$client->setName('My Client Name');
$client->setRedirectUri('https://example.com/');
- $client->setSecret('MyHashedSecret');
+ $client->setSecret(bin2hex('MyHashedSecret'));
$client->setClientIdentifier('MyClientIdentifier');
$this->clientMapper
@@ -117,7 +117,7 @@ class SettingsControllerTest extends TestCase {
->with($this->callback(function (Client $c) {
return $c->getName() === 'My Client Name' &&
$c->getRedirectUri() === 'https://example.com/' &&
- $c->getSecret() === 'MyHashedSecret' &&
+ $c->getSecret() === bin2hex('MyHashedSecret') &&
$c->getClientIdentifier() === 'MyClientIdentifier';
}))->willReturnCallback(function (Client $c) {
$c->setId(42);
@@ -160,7 +160,7 @@ class SettingsControllerTest extends TestCase {
$client->setId(123);
$client->setName('My Client Name');
$client->setRedirectUri('https://example.com/');
- $client->setSecret('MyHashedSecret');
+ $client->setSecret(bin2hex('MyHashedSecret'));
$client->setClientIdentifier('MyClientIdentifier');
$this->clientMapper