Merge pull request #2163 from nextcloud/app-password-scope-warngings

fix warnings when updating app password
This commit is contained in:
Morris Jobke 2016-11-17 17:52:23 +01:00 committed by GitHub
commit bba32cf4b7
2 changed files with 3 additions and 5 deletions

View File

@ -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 [];

View File

@ -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]));
}
}