diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-01-02 22:41:03 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-01-02 22:41:03 +0100 |
commit | dbd230da7407ac70483c004bc82f4b8619c42760 (patch) | |
tree | 14e016f85e6a8466a2dfcdbeadaab0adb8cff153 /vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php | |
parent | a19563e1396cb882063db3ce3f355b2db48175e9 (diff) | |
download | volse-hubzilla-dbd230da7407ac70483c004bc82f4b8619c42760.tar.gz volse-hubzilla-dbd230da7407ac70483c004bc82f4b8619c42760.tar.bz2 volse-hubzilla-dbd230da7407ac70483c004bc82f4b8619c42760.zip |
update composer libs
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') + ); + } } |