ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
BuildTest.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\Uri;
4
6
10 function testBuild($value) {
11
12 $this->assertEquals(
13 $value,
14 build(parse_url($value))
15 );
16
17 }
18
19 function buildUriData() {
20
21 return [
22 ['http://example.org/'],
23 ['http://example.org/foo/bar'],
24 ['//example.org/foo/bar'],
25 ['/foo/bar'],
26 ['http://example.org:81/'],
27 ['http://user@example.org:81/'],
28 ['http://example.org:81/hi?a=b'],
29 ['http://example.org:81/hi?a=b#c=d'],
30 // [ '//example.org:81/hi?a=b#c=d'], // Currently fails due to a
31 // PHP bug.
32 ['/hi?a=b#c=d'],
33 ['?a=b#c=d'],
34 ['#c=d'],
35 ['file:///etc/hosts'],
36 ['file://localhost/etc/hosts'],
37 ];
38
39 }
40
41}
An exception for terminatinating execution or to throw for unit testing.
testBuild($value)
@dataProvider buildUriData
Definition: BuildTest.php:10
build(array $parts)
This function takes the components returned from PHP's parse_url, and uses it to generate a new uri.
Definition: functions.php:221