mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
fix(oauth2): fix tests
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
parent
f226974c50
commit
ca587b1108
3 changed files with 9 additions and 9 deletions
|
|
@ -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'))
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue