summaryrefslogtreecommitdiff
path: root/server/vendor/guzzlehttp/psr7/tests/UriTest.php
diff options
context:
space:
mode:
authorjosselin <josselin@serverpc.home>2016-01-25 22:12:25 +0100
committerjosselin <josselin@serverpc.home>2016-01-25 22:12:25 +0100
commit793a61475e0045383b23ddb2357a9e632bc8679c (patch)
treec641e37cd8ec87e6c6a61a8a27c90f1b21b518f8 /server/vendor/guzzlehttp/psr7/tests/UriTest.php
parent5f34f504b08b34aad35d232d3ea35f2b4b70b070 (diff)
parent81d5c2a6464771c9a180d0214706a2f65f0b1d18 (diff)
Merge branch 'master' into Eole
Diffstat (limited to 'server/vendor/guzzlehttp/psr7/tests/UriTest.php')
-rw-r--r--server/vendor/guzzlehttp/psr7/tests/UriTest.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/server/vendor/guzzlehttp/psr7/tests/UriTest.php b/server/vendor/guzzlehttp/psr7/tests/UriTest.php
index 2776920..a63293c 100644
--- a/server/vendor/guzzlehttp/psr7/tests/UriTest.php
+++ b/server/vendor/guzzlehttp/psr7/tests/UriTest.php
@@ -244,4 +244,38 @@ class UriTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('foo', $uri->getPath());
$this->assertEquals('bar.com/foo', (string) $uri);
}
+
+ /**
+ * @dataProvider pathTestNoAuthority
+ */
+ public function testNoAuthority($input)
+ {
+ $uri = new Uri($input);
+
+ $this->assertEquals($input, (string) $uri);
+ }
+
+ public function pathTestNoAuthority()
+ {
+ return [
+ // path-rootless
+ ['urn:example:animal:ferret:nose'],
+ // path-absolute
+ ['urn:/example:animal:ferret:nose'],
+ ['urn:/'],
+ // path-empty
+ ['urn:'],
+ ['urn'],
+ ];
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage Unable to parse URI
+ */
+ public function testNoAuthorityWithInvalidPath()
+ {
+ $input = 'urn://example:animal:ferret:nose';
+ $uri = new Uri($input);
+ }
}