fix warnings when updating app password

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/2163/head
Robin Appelman 10 years ago
parent 61453f5fd5
commit d2dee32756
No known key found for this signature in database
GPG Key ID: 425003AC385454C5
  1. 3
      settings/Controller/AuthSettingsController.php
  2. 5
      tests/Settings/Controller/AuthSettingsControllerTest.php

@ -192,8 +192,7 @@ class AuthSettingsController extends Controller {
public function update($id, array $scope) {
$token = $this->tokenProvider->getTokenById($id);
$token->setScope([
'filesystem' => $scope['filesystem'],
'app' => array_values($scope['apps'])
'filesystem' => $scope['filesystem']
]);
$this->tokenProvider->updateToken($token);
return [];

@ -212,15 +212,14 @@ class AuthSettingsControllerTest extends TestCase {
$token->expects($this->once())
->method('setScope')
->with($this->equalTo([
'filesystem' => true,
'app' => ['dav', 'myapp']
'filesystem' => true
]));
$this->tokenProvider->expects($this->once())
->method('updateToken')
->with($this->equalTo($token));
$this->assertSame([], $this->controller->update(42, ['filesystem' => true, 'apps' => ['dav', 'myapp']]));
$this->assertSame([], $this->controller->update(42, ['filesystem' => true]));
}
}

Loading…
Cancel
Save