aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php
diff options
context:
space:
mode:
authorManuel Jiménez Friaza <mjfriaza@openmailbox.org>2019-01-20 12:58:27 +0100
committerManuel Jiménez Friaza <mjfriaza@openmailbox.org>2019-01-20 12:58:27 +0100
commit4e8fc6d19851b6d05a49d5151aaa1f0f1fcfb5c0 (patch)
tree49111cffad0616616f4ce76fed9dd6b4fad8e41f /vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php
parent618d673947dc627dcdac3f9b6da7f31123472b05 (diff)
parent39128c34ccf48cc23ed368cf5bbedd71b5ef75db (diff)
downloadvolse-hubzilla-4e8fc6d19851b6d05a49d5151aaa1f0f1fcfb5c0.tar.gz
volse-hubzilla-4e8fc6d19851b6d05a49d5151aaa1f0f1fcfb5c0.tar.bz2
volse-hubzilla-4e8fc6d19851b6d05a49d5151aaa1f0f1fcfb5c0.zip
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php')
-rw-r--r--vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php23
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')
+ );
+ }
}