|
|
|
|
@ -158,6 +158,10 @@ class ClientFlowLoginControllerTest extends TestCase { |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getName') |
|
|
|
|
->willReturn('ExampleCloud'); |
|
|
|
|
$this->request |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getServerProtocol') |
|
|
|
|
->willReturn('http'); |
|
|
|
|
$this->request |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getServerHost') |
|
|
|
|
@ -214,6 +218,10 @@ class ClientFlowLoginControllerTest extends TestCase { |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getName') |
|
|
|
|
->willReturn('ExampleCloud'); |
|
|
|
|
$this->request |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getServerProtocol') |
|
|
|
|
->willReturn('http'); |
|
|
|
|
$this->request |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getServerHost') |
|
|
|
|
@ -423,12 +431,16 @@ class ClientFlowLoginControllerTest extends TestCase { |
|
|
|
|
IToken::PERMANENT_TOKEN, |
|
|
|
|
IToken::DO_NOT_REMEMBER |
|
|
|
|
); |
|
|
|
|
$this->request |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getServerProtocol') |
|
|
|
|
->willReturn('http'); |
|
|
|
|
$this->request |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getServerHost') |
|
|
|
|
->willReturn('example.com'); |
|
|
|
|
|
|
|
|
|
$expected = new Http\RedirectResponse('nc://login/server:example.com&user:MyLoginName&password:MyGeneratedToken'); |
|
|
|
|
$expected = new Http\RedirectResponse('nc://login/server:http://example.com&user:MyLoginName&password:MyGeneratedToken'); |
|
|
|
|
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -571,12 +583,16 @@ class ClientFlowLoginControllerTest extends TestCase { |
|
|
|
|
IToken::PERMANENT_TOKEN, |
|
|
|
|
IToken::DO_NOT_REMEMBER |
|
|
|
|
); |
|
|
|
|
$this->request |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getServerProtocol') |
|
|
|
|
->willReturn('http'); |
|
|
|
|
$this->request |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('getServerHost') |
|
|
|
|
->willReturn('example.com'); |
|
|
|
|
|
|
|
|
|
$expected = new Http\RedirectResponse('nc://login/server:example.com&user:MyLoginName&password:MyGeneratedToken'); |
|
|
|
|
$expected = new Http\RedirectResponse('nc://login/server:http://example.com&user:MyLoginName&password:MyGeneratedToken'); |
|
|
|
|
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|