From 81d5c2a6464771c9a180d0214706a2f65f0b1d18 Mon Sep 17 00:00:00 2001 From: josselin Date: Mon, 25 Jan 2016 22:08:02 +0100 Subject: Added php-opencloud/openstack as SubModule --- server/vendor/guzzlehttp/psr7/tests/UriTest.php | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'server/vendor/guzzlehttp/psr7/tests/UriTest.php') 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); + } } -- cgit v1.2.3