ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
URITest Class Reference
+ Inheritance diagram for URITest:
+ Collaboration diagram for URITest:

Public Member Functions

const test_init ()
 
 test_ipv4 ()
 test_init More...
 
 testIPv6 (string $host)
 test_init provideIPv6addresses More...
 
 test_localhost ()
 test_init More...
 
 test_components ($uri)
 test_init More...
 
 test_base_uri ($uri)
 test_init More...
 
 test_base_uri_idempotent ($uri)
 test_init More...
 
 test_no_path ()
 test_init More...
 
 test_no_query ()
 test_init More...
 
 test_authority_and_query ()
 test_init More...
 
 test_authority_and_fragment ()
 test_init More...
 
 test_authority_path_fragment ()
 test_init More...
 
 test_path ()
 test_init More...
 
 test_authority_only ()
 test_init More...
 
 test_no_schema ()
 test_init More...
 
 test_no_authority ()
 test_init More...
 
 test_wrong_char_in_schema ()
 test_init More...
 
 test_wrong_authority_in_schema_1 ()
 test_init More...
 
 test_wrong_authority_in_schema_2 ()
 test_init More...
 
 test_uri_invalid ()
 test_init More...
 
 test_realpctenc ()
 test_init More...
 
 test_fakepcenc ()
 test_init More...
 
 test_alphadigit_start_host ()
 test_init More...
 
 test_alphadigit_start_host_2 ()
 test_init More...
 
 test_alphadigit_start_host_3 ()
 test_init More...
 
 test_alphadigit_start_host_4 ()
 test_init More...
 
 test_alphadigit_start_host_5 ()
 test_init More...
 
 test_with_schema ($uri)
 test_init More...
 
 test_with_schema_invalid_1 ()
 test_with_schema More...
 
 test_with_schema_invalid_2 ()
 test_with_schema More...
 
 test_with_port ($uri)
 test_init More...
 
 test_with_port_invalid_1 ()
 test_with_port More...
 
 test_with_port_invalid_2 ()
 test_with_port More...
 
 test_with_host ($uri)
 test_init More...
 
 test_with_host_invalid_1 ()
 test_with_host More...
 
 test_with_host_invalid_3 ()
 test_with_host More...
 
 test_with_host_invalid_4 ()
 test_with_host More...
 
 test_with_authority ($uri)
 test_init More...
 
 test_with_authority_invalid_1 ()
 test_with_authority More...
 
 test_with_authority_invalid_2 ()
 test_with_authority More...
 
 test_with_authority_invalid_3 ()
 test_with_authority More...
 
 test_with_authority_invalid_4 ()
 test_with_authority More...
 
 test_with_authority_invalid_5 ()
 test_with_authority More...
 
 test_with_authority_invalid_6 ()
 test_with_authority More...
 
 test_with_authority_invalid_7 ()
 test_with_authority More...
 
 test_with_authority_invalid_8 ()
 test_with_authority More...
 
 test_with_path ($uri)
 test_init More...
 
 test_with_path_invalid_1 ()
 test_with_path More...
 
 test_with_path_invalid_2 ()
 test_with_path More...
 
 test_with_path_invalid_3 ()
 test_with_path More...
 
 test_with_query ($uri)
 test_init More...
 
 test_with_query_invalid_1 ()
 test_with_query More...
 
 test_with_query_invalid_2 ()
 test_with_query More...
 
 test_with_fragment ($uri)
 test_init More...
 
 test_with_fragment_invalid_1 ()
 test_with_fragment More...
 
 test_with_fragment_invalid_2 ()
 test_with_fragment More...
 
 testToString ()
 
 testGetParameters ()
 
 testGetParameter (ILIAS\Data\URI $uri)
 testGetParameters More...
 
 testWithParameters (ILIAS\Data\URI $uri)
 testGetParameters More...
 
 testSubstituteParameter (ILIAS\Data\URI $uri)
 testWithParameters More...
 
 testAppendParameter (ILIAS\Data\URI $uri)
 testWithParameters More...
 
 testWithArrayParameters (ILIAS\Data\URI $uri)
 testGetParameters More...
 
 testWithOutParameters ()
 

Static Public Member Functions

static provideIPv6addresses ()
 

Private Attributes

const URI_COMPLETE = 'g+it://github.com:8080/someaccount/somerepo/somerepo.git?query_par_1=val_1&query_par_2=val_2#fragment'
 
const URI_COMPLETE_IPV4 = 'g+it://10.0.0.86:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment'
 
const URI_COMPLETE_LOCALHOST = 'g+it://localhost:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment'
 
const URI_NO_PATH_1 = 'g-it://ilias%2Da.de:8080?query_par_1=val_1&query_par_2=val_2#fragment'
 
const URI_NO_PATH_2 = 'g.it://amaz;on.co.uk:8080/?query_par_1=val_1&query_par_2=val_2#fragment'
 
const URI_NO_QUERY_1 = 'git://one-letter-top-level.a:8080/someaccount/somerepo/somerepo.git/#fragment'
 
const URI_NO_QUERY_2 = 'git://github.com:8080/someaccount/somerepo/somerepo.git#fragment'
 
const URI_AUTHORITY_AND_QUERY_1 = 'git://github.com?query_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2'
 
const URI_AUTHORITY_AND_QUERY_2 = 'git://github.com/?qu/ery_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2'
 
const URI_AUTHORITY_AND_FRAGMENT = 'git://github.com:8080/#fragment$,;:A!\'*+()ar_1=val_1&'
 
const URI_AUTHORITY_PATH_FRAGMENT = 'git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git#frag:A!\'*+()arment'
 
const URI_PATH = 'git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git/'
 
const URI_AUTHORITY_ONLY = 'git://git$,;hub.com'
 
const URI_NO_SCHEMA = 'git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git/'
 
const URI_NO_AUTHORITY = 'git://:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment'
 
const URI_WRONG_SCHEMA = 'gi$t://git$,;hub.com'
 
const URI_WRONG_AUTHORITY_1 = 'git://git$,;hu<b.com:8080/someacc$,;ount/somerepo/somerepo.git/'
 
const URI_WRONG_AUTHORITY_2 = 'git://git$,;hu=b.com/someacc$,;ount/somerepo/somerepo.git/'
 
const URI_INVALID = 'https://host.de/ilias.php/"><script>alert(1)</script>?baseClass=ilObjChatroomGUI&cmd=getOSDNotifications&cmdMode=asynch&max_age=15192913'
 
const URI_FAKEPCENC = 'g+it://github.com:8080/someaccoun%t/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment'
 
const URI_REALPCTENC = 'g+it://github.com:8080/someaccount%2Fsomerepo/som%2brepo.git/?par_lower=val_%2b&par_upper=val_%C3%A1#fragment'
 
const PATH_REALPCTENC = 'someaccount%2Fsomerepo/som%2brepo.git'
 
const PARAMS_REALPCTENC
 
const const URI_HOST_ALPHADIG_START_1 = 'g+it://-github.com:8080/someaccount'
 
const URI_HOST_ALPHADIG_START_2 = 'g+it://github-.com:8080/someaccount'
 
const URI_HOST_ALPHADIG_START_3 = 'http://.'
 
const URI_HOST_ALPHADIG_START_4 = 'http://../'
 
const URI_HOST_ALPHADIG_START_5 = 'http://-error-.invalid/'
 
const URI_BASE = 'git://github.com:8080/someaccount/somerepo/somerepo.git'
 
const PARAMS
 

Detailed Description

Definition at line 26 of file URITest.php.

Member Function Documentation

◆ provideIPv6addresses()

static URITest::provideIPv6addresses ( )
static

Definition at line 125 of file URITest.php.

125  : array
126  {
127  return [
128  // Long form.
129  ['[1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0]'],
130  ['[1:2:3:4:5:6:7:8]'],
131  // Short form.
132  ['[::1]'],
133  ['[::]'],
134  ['[::Ff00]'],
135  ['[1::]'],
136  ['[::3:4:5:6:7:8]'],
137  ['[3:4:5:6:7:8::]'],
138  ['[12::34]'],
139  // Embedded IPv4 (long).
140  ['[1234:5678:9ABC:DEF0:1234:5678:123.123.123.123]'],
141  // Embedded IPv4 (short).
142  ['[::123.123.123.123]'],
143  ['[1::123.123.123.123]'],
144  ['[1:3:4::123.123.123.123]'],
145  ['[::f:a:123.123.123.123]'],
146  ];
147  }

◆ test_alphadigit_start_host()

URITest::test_alphadigit_start_host ( )

test_init

Definition at line 423 of file URITest.php.

423  : void
424  {
425  $this->expectException(InvalidArgumentException::class);
426  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_1);
427  }

◆ test_alphadigit_start_host_2()

URITest::test_alphadigit_start_host_2 ( )

test_init

Definition at line 432 of file URITest.php.

432  : void
433  {
434  $this->expectException(InvalidArgumentException::class);
435  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_2);
436  }

◆ test_alphadigit_start_host_3()

URITest::test_alphadigit_start_host_3 ( )

test_init

Definition at line 441 of file URITest.php.

441  : void
442  {
443  $this->expectException(InvalidArgumentException::class);
444  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_3);
445  }

◆ test_alphadigit_start_host_4()

URITest::test_alphadigit_start_host_4 ( )

test_init

Definition at line 450 of file URITest.php.

450  : void
451  {
452  $this->expectException(InvalidArgumentException::class);
453  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_4);
454  }

◆ test_alphadigit_start_host_5()

URITest::test_alphadigit_start_host_5 ( )

test_init

Definition at line 459 of file URITest.php.

459  : void
460  {
461  $this->expectException(InvalidArgumentException::class);
462  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_5);
463  }

◆ test_authority_and_fragment()

URITest::test_authority_and_fragment ( )

test_init

Definition at line 289 of file URITest.php.

289  : void
290  {
291  $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_FRAGMENT);
292  $this->assertEquals('git', $uri->getSchema());
293  $this->assertEquals('github.com:8080', $uri->getAuthority());
294  $this->assertEquals('github.com', $uri->getHost());
295  $this->assertEquals('8080', $uri->getPort());
296  $this->assertNull($uri->getPath());
297  $this->assertNull($uri->getQuery());
298  $this->assertEquals('fragment$,;:A!\'*+()ar_1=val_1&', $uri->getFragment());
299  }

◆ test_authority_and_query()

URITest::test_authority_and_query ( )

test_init

Definition at line 265 of file URITest.php.

265  : void
266  {
267  $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_QUERY_1);
268  $this->assertEquals('git', $uri->getSchema());
269  $this->assertEquals('github.com', $uri->getAuthority());
270  $this->assertEquals('github.com', $uri->getHost());
271  $this->assertNull($uri->getPort());
272  $this->assertNull($uri->getPath());
273  $this->assertEquals('query_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2', $uri->getQuery());
274  $this->assertNull($uri->getFragment());
275 
276  $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_QUERY_2);
277  $this->assertEquals('git', $uri->getSchema());
278  $this->assertEquals('github.com', $uri->getAuthority());
279  $this->assertEquals('github.com', $uri->getHost());
280  $this->assertNull($uri->getPort());
281  $this->assertNull($uri->getPath());
282  $this->assertEquals('qu/ery_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2', $uri->getQuery());
283  $this->assertNull($uri->getFragment());
284  }

◆ test_authority_only()

URITest::test_authority_only ( )

test_init

Definition at line 334 of file URITest.php.

334  : void
335  {
336  $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_ONLY);
337  $this->assertEquals('git', $uri->getSchema());
338  $this->assertEquals('git$,;hub.com', $uri->getAuthority());
339  $this->assertEquals('git$,;hub.com', $uri->getHost());
340  $this->assertNull($uri->getPort());
341  $this->assertNull($uri->getPath());
342  $this->assertNull($uri->getQuery());
343  $this->assertNull($uri->getFragment());
344  $this->assertEquals('git://git$,;hub.com', $uri->getBaseURI());
345  }

◆ test_authority_path_fragment()

URITest::test_authority_path_fragment ( )

test_init

Definition at line 303 of file URITest.php.

303  : void
304  {
305  $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_PATH_FRAGMENT);
306  $this->assertEquals('git', $uri->getSchema());
307  $this->assertEquals('git$,;hub.com:8080', $uri->getAuthority());
308  $this->assertEquals('git$,;hub.com', $uri->getHost());
309  $this->assertEquals('8080', $uri->getPort());
310  $this->assertEquals('someacc$,;ount/somerepo/somerepo.git', $uri->getPath());
311  $this->assertNull($uri->getQuery());
312  $this->assertEquals('frag:A!\'*+()arment', $uri->getFragment());
313  }

◆ test_base_uri()

URITest::test_base_uri (   $uri)

test_init

Definition at line 182 of file URITest.php.

182  : void
183  {
184  $this->assertEquals('g+it://github.com:8080/someaccount/somerepo/somerepo.git', $uri->getBaseURI());
185  }

◆ test_base_uri_idempotent()

URITest::test_base_uri_idempotent (   $uri)

test_init

Definition at line 190 of file URITest.php.

190  : void
191  {
192  $base_uri = $uri->getBaseURI();
193  $this->assertEquals('g+it://github.com:8080/someaccount/somerepo/somerepo.git', $base_uri);
194  $this->assertEquals('g+it', $uri->getSchema());
195  $this->assertEquals('github.com:8080', $uri->getAuthority());
196  $this->assertEquals('github.com', $uri->getHost());
197  $this->assertEquals('8080', $uri->getPort());
198  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
199  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
200  $this->assertEquals('fragment', $uri->getFragment());
201 
202  $uri = new ILIAS\Data\URI($base_uri);
203  $this->assertEquals($base_uri, $uri->getBaseURI());
204  $this->assertEquals('g+it', $uri->getSchema());
205  $this->assertEquals('github.com:8080', $uri->getAuthority());
206  $this->assertEquals('github.com', $uri->getHost());
207  $this->assertEquals('8080', $uri->getPort());
208  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
209  $this->assertNull($uri->getQuery());
210  $this->assertNull($uri->getFragment());
211  }

◆ test_components()

URITest::test_components (   $uri)

test_init

Definition at line 168 of file URITest.php.

168  : void
169  {
170  $this->assertEquals('g+it', $uri->getSchema());
171  $this->assertEquals('github.com:8080', $uri->getAuthority());
172  $this->assertEquals('github.com', $uri->getHost());
173  $this->assertEquals('8080', $uri->getPort());
174  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
175  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
176  $this->assertEquals('fragment', $uri->getFragment());
177  }

◆ test_fakepcenc()

URITest::test_fakepcenc ( )

test_init

Definition at line 414 of file URITest.php.

414  : void
415  {
416  $this->expectException(InvalidArgumentException::class);
417  new ILIAS\Data\URI(self::URI_FAKEPCENC);
418  }

◆ test_init()

const URITest::test_init ( )

Definition at line 89 of file URITest.php.

90  {
91  return new ILIAS\Data\URI(self::URI_COMPLETE);
92  }
The scope of this class is split ilias-conform URI&#39;s into components.
Definition: URI.php:34

◆ test_ipv4()

URITest::test_ipv4 ( )

test_init

Definition at line 97 of file URITest.php.

97  : void
98  {
99  $uri = new ILIAS\Data\URI(self::URI_COMPLETE_IPV4);
100  $this->assertEquals('g+it', $uri->getSchema());
101  $this->assertEquals('10.0.0.86:8080', $uri->getAuthority());
102  $this->assertEquals('10.0.0.86', $uri->getHost());
103  $this->assertEquals(8080, $uri->getPort());
104  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
105  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
106  $this->assertEquals('fragment', $uri->getFragment());
107  }

◆ test_localhost()

URITest::test_localhost ( )

test_init

Definition at line 152 of file URITest.php.

152  : void
153  {
154  $uri = new ILIAS\Data\URI(self::URI_COMPLETE_LOCALHOST);
155  $this->assertEquals('g+it', $uri->getSchema());
156  $this->assertEquals('localhost:8080', $uri->getAuthority());
157  $this->assertEquals('localhost', $uri->getHost());
158  $this->assertEquals(8080, $uri->getPort());
159  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
160  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
161  $this->assertEquals('fragment', $uri->getFragment());
162  }

◆ test_no_authority()

URITest::test_no_authority ( )

test_init

Definition at line 359 of file URITest.php.

359  : void
360  {
361  $this->expectException(TypeError::class);
362  new ILIAS\Data\URI(self::URI_NO_AUTHORITY);
363  }

◆ test_no_path()

URITest::test_no_path ( )

test_init

Definition at line 217 of file URITest.php.

217  : void
218  {
219  $uri = new ILIAS\Data\URI(self::URI_NO_PATH_1);
220  $this->assertEquals('g-it', $uri->getSchema());
221  $this->assertEquals('ilias%2Da.de:8080', $uri->getAuthority());
222  $this->assertEquals('ilias%2Da.de', $uri->getHost());
223  $this->assertEquals('8080', $uri->getPort());
224  $this->assertNull($uri->getPath());
225  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
226  $this->assertEquals('fragment', $uri->getFragment());
227 
228  $uri = new ILIAS\Data\URI(self::URI_NO_PATH_2);
229  $this->assertEquals('g.it', $uri->getSchema());
230  $this->assertEquals('amaz;on.co.uk:8080', $uri->getAuthority());
231  $this->assertEquals('amaz;on.co.uk', $uri->getHost());
232  $this->assertEquals('8080', $uri->getPort());
233  $this->assertNull($uri->getPath());
234  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
235  $this->assertEquals('fragment', $uri->getFragment());
236  }

◆ test_no_query()

URITest::test_no_query ( )

test_init

Definition at line 241 of file URITest.php.

241  : void
242  {
243  $uri = new ILIAS\Data\URI(self::URI_NO_QUERY_1);
244  $this->assertEquals('git', $uri->getSchema());
245  $this->assertEquals('one-letter-top-level.a:8080', $uri->getAuthority());
246  $this->assertEquals('one-letter-top-level.a', $uri->getHost());
247  $this->assertEquals('8080', $uri->getPort());
248  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
249  $this->assertNull($uri->getQuery());
250  $this->assertEquals('fragment', $uri->getFragment());
251 
252  $uri = new ILIAS\Data\URI(self::URI_NO_QUERY_2);
253  $this->assertEquals('git', $uri->getSchema());
254  $this->assertEquals('github.com:8080', $uri->getAuthority());
255  $this->assertEquals('github.com', $uri->getHost());
256  $this->assertEquals('8080', $uri->getPort());
257  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
258  $this->assertNull($uri->getQuery());
259  $this->assertEquals('fragment', $uri->getFragment());
260  }

◆ test_no_schema()

URITest::test_no_schema ( )

test_init

Definition at line 350 of file URITest.php.

350  : void
351  {
352  $this->expectException(TypeError::class);
353  new ILIAS\Data\URI(self::URI_NO_SCHEMA);
354  }

◆ test_path()

URITest::test_path ( )

test_init

Definition at line 318 of file URITest.php.

318  : void
319  {
320  $uri = new ILIAS\Data\URI(self::URI_PATH);
321  $this->assertEquals('git', $uri->getSchema());
322  $this->assertEquals('git$,;hub.com:8080', $uri->getAuthority());
323  $this->assertEquals('git$,;hub.com', $uri->getHost());
324  $this->assertEquals('8080', $uri->getPort());
325  $this->assertEquals('someacc$,;ount/somerepo/somerepo.git', $uri->getPath());
326  $this->assertNull($uri->getQuery());
327  $this->assertNull($uri->getFragment());
328  $this->assertEquals('git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git', $uri->getBaseURI());
329  }

◆ test_realpctenc()

URITest::test_realpctenc ( )

test_init

Definition at line 404 of file URITest.php.

404  : void
405  {
406  $uri = new ILIAS\Data\URI(self::URI_REALPCTENC);
407  $this->assertEquals(self::PATH_REALPCTENC, $uri->getPath());
408  $this->assertEquals(self::PARAMS_REALPCTENC, $uri->getParameters());
409  }

◆ test_uri_invalid()

URITest::test_uri_invalid ( )

test_init

Definition at line 395 of file URITest.php.

395  : void
396  {
397  $this->expectException(InvalidArgumentException::class);
398  new ILIAS\Data\URI(self::URI_INVALID);
399  }

◆ test_with_authority()

URITest::test_with_authority (   $uri)

test_init

Definition at line 614 of file URITest.php.

614  : void
615  {
616  $this->assertEquals('g+it', $uri->getSchema());
617  $this->assertEquals('github.com:8080', $uri->getAuthority());
618  $this->assertEquals('github.com', $uri->getHost());
619  $this->assertEquals('8080', $uri->getPort());
620  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
621  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
622  $this->assertEquals('fragment', $uri->getFragment());
623  $uri = $uri->withAuthority('www1.ilias.de');
624  $this->assertEquals('g+it', $uri->getSchema());
625  $this->assertEquals('www1.ilias.de', $uri->getAuthority());
626  $this->assertEquals('www1.ilias.de', $uri->getHost());
627  $this->assertNull($uri->getPort());
628  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
629  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
630  $this->assertEquals('fragment', $uri->getFragment());
631  $uri = $uri->withAuthority('ilias.de:80');
632  $this->assertEquals('g+it', $uri->getSchema());
633  $this->assertEquals('ilias.de:80', $uri->getAuthority());
634  $this->assertEquals('ilias.de', $uri->getHost());
635  $this->assertEquals('80', $uri->getPort());
636  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
637  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
638  $this->assertEquals('fragment', $uri->getFragment());
639  $uri = $uri->withAuthority('a:1');
640  $this->assertEquals('g+it', $uri->getSchema());
641  $this->assertEquals('a:1', $uri->getAuthority());
642  $this->assertEquals('a', $uri->getHost());
643  $this->assertEquals(1, $uri->getPort());
644  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
645  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
646  $this->assertEquals('fragment', $uri->getFragment());
647  $uri = $uri->withAuthority('a');
648  $this->assertEquals('g+it', $uri->getSchema());
649  $this->assertEquals('a', $uri->getAuthority());
650  $this->assertEquals('a', $uri->getHost());
651  $this->assertNull($uri->getPort());
652  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
653  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
654  $this->assertEquals('fragment', $uri->getFragment());
655  $uri = $uri->withAuthority('1.2.3.4');
656  $this->assertEquals('g+it', $uri->getSchema());
657  $this->assertEquals('1.2.3.4', $uri->getAuthority());
658  $this->assertEquals('1.2.3.4', $uri->getHost());
659  $this->assertNull($uri->getPort());
660  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
661  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
662  $this->assertEquals('fragment', $uri->getFragment());
663  $uri = $uri->withAuthority('1.2.3.4:5');
664  $this->assertEquals('g+it', $uri->getSchema());
665  $this->assertEquals('1.2.3.4:5', $uri->getAuthority());
666  $this->assertEquals('1.2.3.4', $uri->getHost());
667  $this->assertEquals(5, $uri->getPort());
668  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
669  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
670  $this->assertEquals('fragment', $uri->getFragment());
671  $uri = $uri->withAuthority('localhost1');
672  $this->assertEquals('g+it', $uri->getSchema());
673  $this->assertEquals('localhost1', $uri->getAuthority());
674  $this->assertEquals('localhost1', $uri->getHost());
675  $this->assertNull($uri->getPort());
676  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
677  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
678  $this->assertEquals('fragment', $uri->getFragment());
679  $uri = $uri->withAuthority('localhost1:10');
680  $this->assertEquals('g+it', $uri->getSchema());
681  $this->assertEquals('localhost1:10', $uri->getAuthority());
682  $this->assertEquals('localhost1', $uri->getHost());
683  $this->assertEquals(10, $uri->getPort());
684  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
685  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
686  $this->assertEquals('fragment', $uri->getFragment());
687  }

◆ test_with_authority_invalid_1()

URITest::test_with_authority_invalid_1 ( )

test_with_authority

Definition at line 692 of file URITest.php.

692  : void
693  {
694  $this->expectException(InvalidArgumentException::class);
695  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
696  $uri->withAuthority('-foo-.de');
697  }

◆ test_with_authority_invalid_2()

URITest::test_with_authority_invalid_2 ( )

test_with_authority

Definition at line 702 of file URITest.php.

702  : void
703  {
704  $this->expectException(InvalidArgumentException::class);
705  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
706  $uri->withAuthority('-bar-.de:6060');
707  }

◆ test_with_authority_invalid_3()

URITest::test_with_authority_invalid_3 ( )

test_with_authority

Definition at line 713 of file URITest.php.

713  : void
714  {
715  $this->expectException(InvalidArgumentException::class);
716  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
717  $uri->withHost('ilias.de:');
718  }

◆ test_with_authority_invalid_4()

URITest::test_with_authority_invalid_4 ( )

test_with_authority

Definition at line 723 of file URITest.php.

723  : void
724  {
725  $this->expectException(InvalidArgumentException::class);
726  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
727  $uri->withHost('ilias.de: ');
728  }

◆ test_with_authority_invalid_5()

URITest::test_with_authority_invalid_5 ( )

test_with_authority

Definition at line 733 of file URITest.php.

733  : void
734  {
735  $this->expectException(InvalidArgumentException::class);
736  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
737  $uri->withHost('ilias.de:aaa');
738  }

◆ test_with_authority_invalid_6()

URITest::test_with_authority_invalid_6 ( )

test_with_authority

Definition at line 743 of file URITest.php.

743  : void
744  {
745  $this->expectException(InvalidArgumentException::class);
746  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
747  $uri->withAuthority('foo.de&<script>');
748  }

◆ test_with_authority_invalid_7()

URITest::test_with_authority_invalid_7 ( )

test_with_authority

Definition at line 754 of file URITest.php.

754  : void
755  {
756  $this->expectException(InvalidArgumentException::class);
757  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
758  $uri->withAuthority('foo.de"><script>alert');
759  }

◆ test_with_authority_invalid_8()

URITest::test_with_authority_invalid_8 ( )

test_with_authority

Definition at line 765 of file URITest.php.

765  : void
766  {
767  $this->expectException(InvalidArgumentException::class);
768  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
769  $uri->withAuthority(' :80');
770  }

◆ test_with_fragment()

URITest::test_with_fragment (   $uri)

test_init

Definition at line 885 of file URITest.php.

885  : void
886  {
887  $this->assertEquals('g+it', $uri->getSchema());
888  $this->assertEquals('github.com:8080', $uri->getAuthority());
889  $this->assertEquals('github.com', $uri->getHost());
890  $this->assertEquals('8080', $uri->getPort());
891  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
892  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
893  $this->assertEquals('fragment', $uri->getFragment());
894  $uri = $uri->withFragment('someFragment');
895  $this->assertEquals('g+it', $uri->getSchema());
896  $this->assertEquals('github.com:8080', $uri->getAuthority());
897  $this->assertEquals('github.com', $uri->getHost());
898  $this->assertEquals('8080', $uri->getPort());
899  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
900  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
901  $this->assertEquals('someFragment', $uri->getFragment());
902  $uri = $uri->withFragment();
903  $this->assertEquals('g+it', $uri->getSchema());
904  $this->assertEquals('github.com:8080', $uri->getAuthority());
905  $this->assertEquals('github.com', $uri->getHost());
906  $this->assertEquals('8080', $uri->getPort());
907  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
908  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
909  $this->assertNull($uri->getFragment());
910  }

◆ test_with_fragment_invalid_1()

URITest::test_with_fragment_invalid_1 ( )

test_with_fragment

Definition at line 915 of file URITest.php.

915  : void
916  {
917  $this->expectException(InvalidArgumentException::class);
918  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
919  $uri->withFragment('aaa[]');
920  }

◆ test_with_fragment_invalid_2()

URITest::test_with_fragment_invalid_2 ( )

test_with_fragment

Definition at line 925 of file URITest.php.

925  : void
926  {
927  $this->expectException(InvalidArgumentException::class);
928  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
929  $uri->withFragment('script>');
930  }

◆ test_with_host()

URITest::test_with_host (   $uri)

test_init

Definition at line 561 of file URITest.php.

561  : void
562  {
563  $this->assertEquals('g+it', $uri->getSchema());
564  $this->assertEquals('github.com:8080', $uri->getAuthority());
565  $this->assertEquals('github.com', $uri->getHost());
566  $this->assertEquals('8080', $uri->getPort());
567  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
568  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
569  $this->assertEquals('fragment', $uri->getFragment());
570  $uri = $uri->withHost('ilias.de');
571  $this->assertEquals('g+it', $uri->getSchema());
572  $this->assertEquals('ilias.de:8080', $uri->getAuthority());
573  $this->assertEquals('ilias.de', $uri->getHost());
574  $this->assertEquals('8080', $uri->getPort());
575  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
576  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
577  $this->assertEquals('fragment', $uri->getFragment());
578  }

◆ test_with_host_invalid_1()

URITest::test_with_host_invalid_1 ( )

test_with_host

Definition at line 584 of file URITest.php.

584  : void
585  {
586  $this->expectException(InvalidArgumentException::class);
587  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
588  $uri->withHost('-foo-.de');
589  }

◆ test_with_host_invalid_3()

URITest::test_with_host_invalid_3 ( )

test_with_host

Definition at line 594 of file URITest.php.

594  : void
595  {
596  $this->expectException(InvalidArgumentException::class);
597  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
598  $uri->withHost('');
599  }

◆ test_with_host_invalid_4()

URITest::test_with_host_invalid_4 ( )

test_with_host

Definition at line 604 of file URITest.php.

604  : void
605  {
606  $this->expectException(InvalidArgumentException::class);
607  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
608  $uri->withHost('ilias.de"><script');
609  }

◆ test_with_path()

URITest::test_with_path (   $uri)

test_init

Definition at line 775 of file URITest.php.

775  : void
776  {
777  $this->assertEquals('g+it', $uri->getSchema());
778  $this->assertEquals('github.com:8080', $uri->getAuthority());
779  $this->assertEquals('github.com', $uri->getHost());
780  $this->assertEquals('8080', $uri->getPort());
781  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
782  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
783  $this->assertEquals('fragment', $uri->getFragment());
784  $uri = $uri->withPath('a/b');
785  $this->assertEquals('g+it', $uri->getSchema());
786  $this->assertEquals('github.com:8080', $uri->getAuthority());
787  $this->assertEquals('github.com', $uri->getHost());
788  $this->assertEquals('8080', $uri->getPort());
789  $this->assertEquals('a/b', $uri->getPath());
790  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
791  $this->assertEquals('fragment', $uri->getFragment());
792  $uri = $uri->withPath();
793  $this->assertEquals('g+it', $uri->getSchema());
794  $this->assertEquals('github.com:8080', $uri->getAuthority());
795  $this->assertEquals('github.com', $uri->getHost());
796  $this->assertEquals('8080', $uri->getPort());
797  $this->assertNull($uri->getPath());
798  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
799  $this->assertEquals('fragment', $uri->getFragment());
800  }

◆ test_with_path_invalid_1()

URITest::test_with_path_invalid_1 ( )

test_with_path

Definition at line 805 of file URITest.php.

805  : void
806  {
807  $this->expectException(InvalidArgumentException::class);
808  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
809  $uri->withPath('/<script>/a');
810  }

◆ test_with_path_invalid_2()

URITest::test_with_path_invalid_2 ( )

test_with_path

Definition at line 815 of file URITest.php.

815  : void
816  {
817  $this->expectException(InvalidArgumentException::class);
818  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
819  $uri->withPath('//a/b');
820  }

◆ test_with_path_invalid_3()

URITest::test_with_path_invalid_3 ( )

test_with_path

Definition at line 825 of file URITest.php.

825  : void
826  {
827  $this->expectException(InvalidArgumentException::class);
828  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
829  $uri->withPath(':a/b');
830  }

◆ test_with_port()

URITest::test_with_port (   $uri)

test_init

Definition at line 510 of file URITest.php.

510  : void
511  {
512  $this->assertEquals('g+it', $uri->getSchema());
513  $this->assertEquals('github.com:8080', $uri->getAuthority());
514  $this->assertEquals('github.com', $uri->getHost());
515  $this->assertEquals('8080', $uri->getPort());
516  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
517  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
518  $this->assertEquals('fragment', $uri->getFragment());
519  $uri = $uri->withPort(80);
520  $this->assertEquals('g+it', $uri->getSchema());
521  $this->assertEquals('github.com:80', $uri->getAuthority());
522  $this->assertEquals('github.com', $uri->getHost());
523  $this->assertEquals('80', $uri->getPort());
524  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
525  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
526  $this->assertEquals('fragment', $uri->getFragment());
527  $uri = $uri->withPort();
528  $this->assertEquals('g+it', $uri->getSchema());
529  $this->assertEquals('github.com', $uri->getAuthority());
530  $this->assertEquals('github.com', $uri->getHost());
531  $this->assertNull($uri->getPort());
532  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
533  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
534  $this->assertEquals('fragment', $uri->getFragment());
535  }

◆ test_with_port_invalid_1()

URITest::test_with_port_invalid_1 ( )

test_with_port

Definition at line 541 of file URITest.php.

541  : void
542  {
543  $this->expectException(TypeError::class);
544  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
545  $uri->withPort('a111');
546  }

◆ test_with_port_invalid_2()

URITest::test_with_port_invalid_2 ( )

test_with_port

Definition at line 551 of file URITest.php.

551  : void
552  {
553  $this->expectException(TypeError::class);
554  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
555  $uri->withPort('foo');
556  }

◆ test_with_query()

URITest::test_with_query (   $uri)

test_init

Definition at line 835 of file URITest.php.

835  : void
836  {
837  $this->assertEquals('g+it', $uri->getSchema());
838  $this->assertEquals('github.com:8080', $uri->getAuthority());
839  $this->assertEquals('github.com', $uri->getHost());
840  $this->assertEquals('8080', $uri->getPort());
841  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
842  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
843  $this->assertEquals('fragment', $uri->getFragment());
844  $uri = $uri->withQuery('query_par_a1=val_a1');
845  $this->assertEquals('g+it', $uri->getSchema());
846  $this->assertEquals('github.com:8080', $uri->getAuthority());
847  $this->assertEquals('github.com', $uri->getHost());
848  $this->assertEquals('8080', $uri->getPort());
849  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
850  $this->assertEquals('query_par_a1=val_a1', $uri->getQuery());
851  $this->assertEquals('fragment', $uri->getFragment());
852  $uri = $uri->withQuery();
853  $this->assertEquals('g+it', $uri->getSchema());
854  $this->assertEquals('github.com:8080', $uri->getAuthority());
855  $this->assertEquals('github.com', $uri->getHost());
856  $this->assertEquals('8080', $uri->getPort());
857  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
858  $this->assertNull($uri->getQuery());
859  $this->assertEquals('fragment', $uri->getFragment());
860  }

◆ test_with_query_invalid_1()

URITest::test_with_query_invalid_1 ( )

test_with_query

Definition at line 865 of file URITest.php.

865  : void
866  {
867  $this->expectException(InvalidArgumentException::class);
868  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
869  $uri->withQuery('<script>a');
870  }

◆ test_with_query_invalid_2()

URITest::test_with_query_invalid_2 ( )

test_with_query

Definition at line 875 of file URITest.php.

875  : void
876  {
877  $this->expectException(InvalidArgumentException::class);
878  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
879  $uri->withQuery('aa[]');
880  }

◆ test_with_schema()

URITest::test_with_schema (   $uri)

test_init

Definition at line 468 of file URITest.php.

468  : void
469  {
470  $this->assertEquals('g+it', $uri->getSchema());
471  $this->assertEquals('github.com:8080', $uri->getAuthority());
472  $this->assertEquals('github.com', $uri->getHost());
473  $this->assertEquals('8080', $uri->getPort());
474  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
475  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
476  $this->assertEquals('fragment', $uri->getFragment());
477  $uri = $uri->withSchema('http');
478  $this->assertEquals('http', $uri->getSchema());
479  $this->assertEquals('github.com:8080', $uri->getAuthority());
480  $this->assertEquals('github.com', $uri->getHost());
481  $this->assertEquals('8080', $uri->getPort());
482  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
483  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
484  $this->assertEquals('fragment', $uri->getFragment());
485  }

◆ test_with_schema_invalid_1()

URITest::test_with_schema_invalid_1 ( )

test_with_schema

Definition at line 490 of file URITest.php.

490  : void
491  {
492  $this->expectException(InvalidArgumentException::class);
493  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
494  $uri->withSchema('');
495  }

◆ test_with_schema_invalid_2()

URITest::test_with_schema_invalid_2 ( )

test_with_schema

Definition at line 500 of file URITest.php.

500  : void
501  {
502  $this->expectException(InvalidArgumentException::class);
503  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
504  $uri->withSchema('1aa');
505  }

◆ test_wrong_authority_in_schema_1()

URITest::test_wrong_authority_in_schema_1 ( )

test_init

Definition at line 377 of file URITest.php.

377  : void
378  {
379  $this->expectException(InvalidArgumentException::class);
380  new ILIAS\Data\URI(self::URI_WRONG_AUTHORITY_1);
381  }

◆ test_wrong_authority_in_schema_2()

URITest::test_wrong_authority_in_schema_2 ( )

test_init

Definition at line 386 of file URITest.php.

386  : void
387  {
388  $this->expectException(InvalidArgumentException::class);
389  new ILIAS\Data\URI(self::URI_WRONG_AUTHORITY_2);
390  }

◆ test_wrong_char_in_schema()

URITest::test_wrong_char_in_schema ( )

test_init

Definition at line 368 of file URITest.php.

368  : void
369  {
370  $this->expectException(TypeError::class);
371  new ILIAS\Data\URI(self::URI_WRONG_SCHEMA);
372  }

◆ testAppendParameter()

URITest::testAppendParameter ( ILIAS\Data\URI  $uri)

testWithParameters

Definition at line 992 of file URITest.php.

References $params.

992  : void
993  {
994  $params = [
995  'x' => 1, 'y' => 2,
996  'z' => 5
997  ];
998  $uri = $uri->withParameter('z', 5);
999  $this->assertEquals(
1000  $params,
1001  $uri->getParameters()
1002  );
1003  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31

◆ testGetParameter()

URITest::testGetParameter ( ILIAS\Data\URI  $uri)

testGetParameters

Definition at line 955 of file URITest.php.

955  : void
956  {
957  $k = array_keys(self::PARAMS)[0];
958  $this->assertEquals(
959  self::PARAMS[$k],
960  $uri->getParameter($k)
961  );
962  }

◆ testGetParameters()

URITest::testGetParameters ( )

Definition at line 941 of file URITest.php.

References $url.

942  {
943  $url = self::URI_BASE . '?' . http_build_query(self::PARAMS);
944  $uri = new ILIAS\Data\URI($url);
945  $this->assertEquals(
946  self::PARAMS,
947  $uri->getParameters()
948  );
949  return $uri;
950  }
$url
Definition: shib_logout.php:66

◆ testIPv6()

URITest::testIPv6 ( string  $host)

test_init provideIPv6addresses

Definition at line 113 of file URITest.php.

References null.

113  : void
114  {
115  $uri = new ILIAS\Data\URI('http://' . $host);
116  $this->assertEquals('http', $uri->getSchema());
117  $this->assertEquals($host, $uri->getAuthority());
118  $this->assertEquals($host, $uri->getHost());
119  $this->assertEquals(null, $uri->getPort());
120  $this->assertEquals(null, $uri->getPath());
121  $this->assertEquals(null, $uri->getQuery());
122  $this->assertEquals(null, $uri->getFragment());
123  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testSubstituteParameter()

URITest::testSubstituteParameter ( ILIAS\Data\URI  $uri)

testWithParameters

Definition at line 981 of file URITest.php.

981  : void
982  {
983  $uri = $uri->withParameter('x', 5);
984  $this->assertEquals(
985  5,
986  $uri->getParameter('x')
987  );
988  }

◆ testToString()

URITest::testToString ( )

Definition at line 932 of file URITest.php.

932  : void
933  {
934  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
935  $this->assertEquals(
936  self::URI_COMPLETE,
937  $uri
938  );
939  }

◆ testWithArrayParameters()

URITest::testWithArrayParameters ( ILIAS\Data\URI  $uri)

testGetParameters

Definition at line 1008 of file URITest.php.

References $params.

1008  : void
1009  {
1010  $params = ['x' => 1, 'y' => [10, 11, 12]];
1011  $uri = $uri->withParameters($params);
1012  $this->assertEquals(
1013  $params,
1014  $uri->getParameters()
1015  );
1016  $this->assertEquals(
1017  'git://github.com:8080/someaccount/somerepo/somerepo.git?x=1&y%5B0%5D=10&y%5B1%5D=11&y%5B2%5D=12',
1018  $uri
1019  );
1020  $this->assertEquals(
1021  $params['y'],
1022  $uri->getParameter('y')
1023  );
1024  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31

◆ testWithOutParameters()

URITest::testWithOutParameters ( )

Definition at line 1026 of file URITest.php.

1026  : void
1027  {
1028  $uri = new ILIAS\Data\URI(self::URI_NO_QUERY_2);
1029  $this->assertEquals(
1030  [],
1031  $uri->getParameters()
1032  );
1033 
1034  $this->assertNull($uri->getParameter('y'));
1035 
1036  $this->assertEquals(
1037  self::URI_NO_QUERY_2,
1038  (string) $uri
1039  );
1040  }

◆ testWithParameters()

URITest::testWithParameters ( ILIAS\Data\URI  $uri)

testGetParameters

Definition at line 967 of file URITest.php.

References $params.

968  {
969  $params = ['x' => 1, 'y' => 2];
970  $uri = $uri->withParameters($params);
971  $this->assertEquals(
972  $params,
973  $uri->getParameters()
974  );
975  return $uri;
976  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31

Field Documentation

◆ PARAMS

const URITest::PARAMS
private
Initial value:
= [
'par_1' => 'val_1'

Definition at line 80 of file URITest.php.

◆ PARAMS_REALPCTENC

const URITest::PARAMS_REALPCTENC
private
Initial value:
= [
'par_lower' => 'val_+'

Definition at line 68 of file URITest.php.

◆ PATH_REALPCTENC

const URITest::PATH_REALPCTENC = 'someaccount%2Fsomerepo/som%2brepo.git'
private

Definition at line 67 of file URITest.php.

◆ URI_AUTHORITY_AND_FRAGMENT

const URITest::URI_AUTHORITY_AND_FRAGMENT = 'git://github.com:8080/#fragment$,;:A!\'*+()ar_1=val_1&'
private

Definition at line 44 of file URITest.php.

◆ URI_AUTHORITY_AND_QUERY_1

const URITest::URI_AUTHORITY_AND_QUERY_1 = 'git://github.com?query_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2'
private

Definition at line 41 of file URITest.php.

◆ URI_AUTHORITY_AND_QUERY_2

const URITest::URI_AUTHORITY_AND_QUERY_2 = 'git://github.com/?qu/ery_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2'
private

Definition at line 42 of file URITest.php.

◆ URI_AUTHORITY_ONLY

const URITest::URI_AUTHORITY_ONLY = 'git://git$,;hub.com'
private

Definition at line 50 of file URITest.php.

◆ URI_AUTHORITY_PATH_FRAGMENT

const URITest::URI_AUTHORITY_PATH_FRAGMENT = 'git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git#frag:A!\'*+()arment'
private

Definition at line 46 of file URITest.php.

◆ URI_BASE

const URITest::URI_BASE = 'git://github.com:8080/someaccount/somerepo/somerepo.git'
private

Definition at line 79 of file URITest.php.

◆ URI_COMPLETE

const URITest::URI_COMPLETE = 'g+it://github.com:8080/someaccount/somerepo/somerepo.git?query_par_1=val_1&query_par_2=val_2#fragment'
private

Definition at line 28 of file URITest.php.

◆ URI_COMPLETE_IPV4

const URITest::URI_COMPLETE_IPV4 = 'g+it://10.0.0.86:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment'
private

Definition at line 30 of file URITest.php.

◆ URI_COMPLETE_LOCALHOST

const URITest::URI_COMPLETE_LOCALHOST = 'g+it://localhost:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment'
private

Definition at line 32 of file URITest.php.

◆ URI_FAKEPCENC

const URITest::URI_FAKEPCENC = 'g+it://github.com:8080/someaccoun%t/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment'
private

Definition at line 64 of file URITest.php.

◆ URI_HOST_ALPHADIG_START_1

const const URITest::URI_HOST_ALPHADIG_START_1 = 'g+it://-github.com:8080/someaccount'
private

Definition at line 73 of file URITest.php.

◆ URI_HOST_ALPHADIG_START_2

const URITest::URI_HOST_ALPHADIG_START_2 = 'g+it://github-.com:8080/someaccount'
private

Definition at line 74 of file URITest.php.

◆ URI_HOST_ALPHADIG_START_3

const URITest::URI_HOST_ALPHADIG_START_3 = 'http://.'
private

Definition at line 75 of file URITest.php.

◆ URI_HOST_ALPHADIG_START_4

const URITest::URI_HOST_ALPHADIG_START_4 = 'http://../'
private

Definition at line 76 of file URITest.php.

◆ URI_HOST_ALPHADIG_START_5

const URITest::URI_HOST_ALPHADIG_START_5 = 'http://-error-.invalid/'
private

Definition at line 77 of file URITest.php.

◆ URI_INVALID

const URITest::URI_INVALID = 'https://host.de/ilias.php/"><script>alert(1)</script>?baseClass=ilObjChatroomGUI&cmd=getOSDNotifications&cmdMode=asynch&max_age=15192913'
private

Definition at line 62 of file URITest.php.

◆ URI_NO_AUTHORITY

const URITest::URI_NO_AUTHORITY = 'git://:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment'
private

Definition at line 54 of file URITest.php.

◆ URI_NO_PATH_1

const URITest::URI_NO_PATH_1 = 'g-it://ilias%2Da.de:8080?query_par_1=val_1&query_par_2=val_2#fragment'
private

Definition at line 35 of file URITest.php.

◆ URI_NO_PATH_2

const URITest::URI_NO_PATH_2 = 'g.it://amaz;on.co.uk:8080/?query_par_1=val_1&query_par_2=val_2#fragment'
private

Definition at line 36 of file URITest.php.

◆ URI_NO_QUERY_1

const URITest::URI_NO_QUERY_1 = 'git://one-letter-top-level.a:8080/someaccount/somerepo/somerepo.git/#fragment'
private

Definition at line 38 of file URITest.php.

◆ URI_NO_QUERY_2

const URITest::URI_NO_QUERY_2 = 'git://github.com:8080/someaccount/somerepo/somerepo.git#fragment'
private

Definition at line 39 of file URITest.php.

◆ URI_NO_SCHEMA

const URITest::URI_NO_SCHEMA = 'git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git/'
private

Definition at line 52 of file URITest.php.

◆ URI_PATH

const URITest::URI_PATH = 'git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git/'
private

Definition at line 48 of file URITest.php.

◆ URI_REALPCTENC

const URITest::URI_REALPCTENC = 'g+it://github.com:8080/someaccount%2Fsomerepo/som%2brepo.git/?par_lower=val_%2b&par_upper=val_%C3%A1#fragment'
private

Definition at line 66 of file URITest.php.

◆ URI_WRONG_AUTHORITY_1

const URITest::URI_WRONG_AUTHORITY_1 = 'git://git$,;hu<b.com:8080/someacc$,;ount/somerepo/somerepo.git/'
private

Definition at line 58 of file URITest.php.

◆ URI_WRONG_AUTHORITY_2

const URITest::URI_WRONG_AUTHORITY_2 = 'git://git$,;hu=b.com/someacc$,;ount/somerepo/somerepo.git/'
private

Definition at line 59 of file URITest.php.

◆ URI_WRONG_SCHEMA

const URITest::URI_WRONG_SCHEMA = 'gi$t://git$,;hub.com'
private

Definition at line 56 of file URITest.php.


The documentation for this class was generated from the following file: