diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-18 11:06:17 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-18 11:06:17 +0100 |
commit | a184e350d71d6ee94d8223311e5dbb4f869b4e3a (patch) | |
tree | 5fad3c7ee22b78fbeb438fa737b3af7e045c69ac /tests | |
parent | f2724992fcb236b211f6e72aa7b3ac0dec5a7f3b (diff) | |
parent | 911763aad50e27f5d8c667fead8e9a7f6d852a9a (diff) | |
download | nextcloud-server-a184e350d71d6ee94d8223311e5dbb4f869b4e3a.tar.gz nextcloud-server-a184e350d71d6ee94d8223311e5dbb4f869b4e3a.zip |
Merge remote-tracking branch 'origin/master' into filecache-extension
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Core/Controller/ClientFlowLoginControllerTest.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index 50280e18371..1401eac67d8 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -398,7 +398,16 @@ class ClientFlowLoginControllerTest extends TestCase { $this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken')); } - public function testGeneratePasswordWithPasswordForOauthClient() { + /** + * @param string $redirectUri + * @param string $redirectUrl + * + * @testWith + * ["https://example.com/redirect.php", "https://example.com/redirect.php?state=MyOauthState&code=MyAccessCode"] + * ["https://example.com/redirect.php?hello=world", "https://example.com/redirect.php?hello=world&state=MyOauthState&code=MyAccessCode"] + * + */ + public function testGeneratePasswordWithPasswordForOauthClient($redirectUri, $redirectUrl) { $this->session ->expects($this->at(0)) ->method('get') @@ -471,7 +480,7 @@ class ClientFlowLoginControllerTest extends TestCase { ->willReturn($token); $client = new Client(); $client->setName('My OAuth client'); - $client->setRedirectUri('https://example.com/redirect.php'); + $client->setRedirectUri($redirectUri); $this->clientMapper ->expects($this->once()) ->method('getByIdentifier') @@ -481,7 +490,7 @@ class ClientFlowLoginControllerTest extends TestCase { $this->eventDispatcher->expects($this->once()) ->method('dispatch'); - $expected = new Http\RedirectResponse('https://example.com/redirect.php?state=MyOauthState&code=MyAccessCode'); + $expected = new Http\RedirectResponse($redirectUrl); $this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken', 'MyClientIdentifier')); } |