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) { public function update($id, array $scope) {
$token = $this->tokenProvider->getTokenById($id); $token = $this->tokenProvider->getTokenById($id);
$token->setScope([ $token->setScope([
'filesystem' => $scope['filesystem'], 'filesystem' => $scope['filesystem']
'app' => array_values($scope['apps'])
]); ]);
$this->tokenProvider->updateToken($token); $this->tokenProvider->updateToken($token);
return []; return [];

View File

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