diff options
author | M. Dent <dentm42@gmail.com> | 2019-01-09 19:09:20 +0100 |
---|---|---|
committer | M. Dent <dentm42@gmail.com> | 2019-01-09 19:09:20 +0100 |
commit | b22caef65fe2d87d702592bd0ecb057d21c168dd (patch) | |
tree | e7c03427486d012a2996ae21b25070eeafca74c4 /vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php | |
parent | db4281164cf788eece76771bf69f08d7926600f2 (diff) | |
parent | dbd230da7407ac70483c004bc82f4b8619c42760 (diff) | |
download | volse-hubzilla-b22caef65fe2d87d702592bd0ecb057d21c168dd.tar.gz volse-hubzilla-b22caef65fe2d87d702592bd0ecb057d21c168dd.tar.bz2 volse-hubzilla-b22caef65fe2d87d702592bd0ecb057d21c168dd.zip |
Merge branch 'composer_updates' into 'dev'
update composer libs
See merge request hubzilla/core!1455
Diffstat (limited to 'vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php')
-rw-r--r-- | vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php index 2d2c57ee6..172bc88fd 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php @@ -1,6 +1,8 @@ <?php -namespace OAuth2;use PHPUnit\Framework\TestCase; +namespace OAuth2; + +use PHPUnit\Framework\TestCase; class ResponseTest extends TestCase { @@ -14,4 +16,23 @@ class ResponseTest extends TestCase $string = $response->getResponseBody('xml'); $this->assertContains('<response><foo>bar</foo><halland>oates</halland></response>', $string); } + + public function testSetRedirect() + { + $response = new Response(); + $url = 'https://foo/bar'; + $state = 'stateparam'; + $response->setRedirect(301, $url, $state); + $this->assertEquals( + sprintf('%s?state=%s', $url, $state), + $response->getHttpHeader('Location') + ); + + $query = 'query=foo'; + $response->setRedirect(301, $url . '?' . $query, $state); + $this->assertEquals( + sprintf('%s?%s&state=%s', $url, $query, $state), + $response->getHttpHeader('Location') + ); + } } |