/** @var AuthSettingsController */
private $controller;
private $request;
+ /** @var IProvider|\PHPUnit_Framework_MockObject_MockObject */
private $tokenProvider;
private $userManager;
private $session;
$this->assertEquals([], $this->controller->destroy($id));
}
+ public function testUpdateToken() {
+ $token = $this->createMock(DefaultToken::class);
+
+ $this->tokenProvider->expects($this->once())
+ ->method('getTokenById')
+ ->with($this->equalTo(42))
+ ->willReturn($token);
+
+ $token->expects($this->once())
+ ->method('setScope')
+ ->with($this->equalTo([
+ 'filesystem' => true,
+ 'app' => ['dav', 'myapp']
+ ]));
+
+ $this->tokenProvider->expects($this->once())
+ ->method('updateToken')
+ ->with($this->equalTo($token));
+
+ $this->assertSame([], $this->controller->update(42, ['filesystem' => true, 'apps' => ['dav', 'myapp']]));
+ }
+
}