Merge pull request #2163 from nextcloud/app-password-scope-warngings
fix warnings when updating app password
This commit is contained in:
commit
bba32cf4b7
|
@ -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 [];
|
||||||
|
|
|
@ -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]));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue