ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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...
 
 provideIPv6addresses ()
 
 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 ()
 

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 10 of file URITest.php.

Member Function Documentation

◆ provideIPv6addresses()

URITest::provideIPv6addresses ( )

Definition at line 109 of file URITest.php.

109  : array
110  {
111  return [
112  // Long form.
113  ['[1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0]'],
114  ['[1:2:3:4:5:6:7:8]'],
115  // Short form.
116  ['[::1]'],
117  ['[::]'],
118  ['[::Ff00]'],
119  ['[1::]'],
120  ['[::3:4:5:6:7:8]'],
121  ['[3:4:5:6:7:8::]'],
122  ['[12::34]'],
123  // Embedded IPv4 (long).
124  ['[1234:5678:9ABC:DEF0:1234:5678:123.123.123.123]'],
125  // Embedded IPv4 (short).
126  ['[::123.123.123.123]'],
127  ['[1::123.123.123.123]'],
128  ['[1:3:4::123.123.123.123]'],
129  ['[::f:a:123.123.123.123]'],
130  ];
131  }

◆ test_alphadigit_start_host()

URITest::test_alphadigit_start_host ( )

test_init

Definition at line 407 of file URITest.php.

407  : void
408  {
409  $this->expectException(InvalidArgumentException::class);
410  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_1);
411  }

◆ test_alphadigit_start_host_2()

URITest::test_alphadigit_start_host_2 ( )

test_init

Definition at line 416 of file URITest.php.

416  : void
417  {
418  $this->expectException(InvalidArgumentException::class);
419  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_2);
420  }

◆ test_alphadigit_start_host_3()

URITest::test_alphadigit_start_host_3 ( )

test_init

Definition at line 425 of file URITest.php.

425  : void
426  {
427  $this->expectException(InvalidArgumentException::class);
428  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_3);
429  }

◆ test_alphadigit_start_host_4()

URITest::test_alphadigit_start_host_4 ( )

test_init

Definition at line 434 of file URITest.php.

434  : void
435  {
436  $this->expectException(InvalidArgumentException::class);
437  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_4);
438  }

◆ test_alphadigit_start_host_5()

URITest::test_alphadigit_start_host_5 ( )

test_init

Definition at line 443 of file URITest.php.

443  : void
444  {
445  $this->expectException(InvalidArgumentException::class);
446  new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_5);
447  }

◆ test_authority_and_fragment()

URITest::test_authority_and_fragment ( )

test_init

Definition at line 273 of file URITest.php.

273  : void
274  {
275  $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_FRAGMENT);
276  $this->assertEquals('git', $uri->getSchema());
277  $this->assertEquals('github.com:8080', $uri->getAuthority());
278  $this->assertEquals('github.com', $uri->getHost());
279  $this->assertEquals('8080', $uri->getPort());
280  $this->assertNull($uri->getPath());
281  $this->assertNull($uri->getQuery());
282  $this->assertEquals('fragment$,;:A!\'*+()ar_1=val_1&', $uri->getFragment());
283  }

◆ test_authority_and_query()

URITest::test_authority_and_query ( )

test_init

Definition at line 249 of file URITest.php.

249  : void
250  {
251  $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_QUERY_1);
252  $this->assertEquals('git', $uri->getSchema());
253  $this->assertEquals('github.com', $uri->getAuthority());
254  $this->assertEquals('github.com', $uri->getHost());
255  $this->assertNull($uri->getPort());
256  $this->assertNull($uri->getPath());
257  $this->assertEquals('query_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2', $uri->getQuery());
258  $this->assertNull($uri->getFragment());
259 
260  $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_QUERY_2);
261  $this->assertEquals('git', $uri->getSchema());
262  $this->assertEquals('github.com', $uri->getAuthority());
263  $this->assertEquals('github.com', $uri->getHost());
264  $this->assertNull($uri->getPort());
265  $this->assertNull($uri->getPath());
266  $this->assertEquals('qu/ery_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2', $uri->getQuery());
267  $this->assertNull($uri->getFragment());
268  }

◆ test_authority_only()

URITest::test_authority_only ( )

test_init

Definition at line 318 of file URITest.php.

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

◆ test_authority_path_fragment()

URITest::test_authority_path_fragment ( )

test_init

Definition at line 287 of file URITest.php.

287  : void
288  {
289  $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_PATH_FRAGMENT);
290  $this->assertEquals('git', $uri->getSchema());
291  $this->assertEquals('git$,;hub.com:8080', $uri->getAuthority());
292  $this->assertEquals('git$,;hub.com', $uri->getHost());
293  $this->assertEquals('8080', $uri->getPort());
294  $this->assertEquals('someacc$,;ount/somerepo/somerepo.git', $uri->getPath());
295  $this->assertNull($uri->getQuery());
296  $this->assertEquals('frag:A!\'*+()arment', $uri->getFragment());
297  }

◆ test_base_uri()

URITest::test_base_uri (   $uri)

test_init

Definition at line 166 of file URITest.php.

166  : void
167  {
168  $this->assertEquals('g+it://github.com:8080/someaccount/somerepo/somerepo.git', $uri->getBaseURI());
169  }

◆ test_base_uri_idempotent()

URITest::test_base_uri_idempotent (   $uri)

test_init

Definition at line 174 of file URITest.php.

174  : void
175  {
176  $base_uri = $uri->getBaseURI();
177  $this->assertEquals('g+it://github.com:8080/someaccount/somerepo/somerepo.git', $base_uri);
178  $this->assertEquals('g+it', $uri->getSchema());
179  $this->assertEquals('github.com:8080', $uri->getAuthority());
180  $this->assertEquals('github.com', $uri->getHost());
181  $this->assertEquals('8080', $uri->getPort());
182  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
183  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
184  $this->assertEquals('fragment', $uri->getFragment());
185 
186  $uri = new ILIAS\Data\URI($base_uri);
187  $this->assertEquals($base_uri, $uri->getBaseURI());
188  $this->assertEquals('g+it', $uri->getSchema());
189  $this->assertEquals('github.com:8080', $uri->getAuthority());
190  $this->assertEquals('github.com', $uri->getHost());
191  $this->assertEquals('8080', $uri->getPort());
192  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
193  $this->assertNull($uri->getQuery());
194  $this->assertNull($uri->getFragment());
195  }

◆ test_components()

URITest::test_components (   $uri)

test_init

Definition at line 152 of file URITest.php.

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

◆ test_fakepcenc()

URITest::test_fakepcenc ( )

test_init

Definition at line 398 of file URITest.php.

398  : void
399  {
400  $this->expectException(InvalidArgumentException::class);
401  new ILIAS\Data\URI(self::URI_FAKEPCENC);
402  }

◆ test_init()

const URITest::test_init ( )

Definition at line 73 of file URITest.php.

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

◆ test_ipv4()

URITest::test_ipv4 ( )

test_init

Definition at line 81 of file URITest.php.

81  : void
82  {
83  $uri = new ILIAS\Data\URI(self::URI_COMPLETE_IPV4);
84  $this->assertEquals('g+it', $uri->getSchema());
85  $this->assertEquals('10.0.0.86:8080', $uri->getAuthority());
86  $this->assertEquals('10.0.0.86', $uri->getHost());
87  $this->assertEquals(8080, $uri->getPort());
88  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
89  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
90  $this->assertEquals('fragment', $uri->getFragment());
91  }

◆ test_localhost()

URITest::test_localhost ( )

test_init

Definition at line 136 of file URITest.php.

136  : void
137  {
138  $uri = new ILIAS\Data\URI(self::URI_COMPLETE_LOCALHOST);
139  $this->assertEquals('g+it', $uri->getSchema());
140  $this->assertEquals('localhost:8080', $uri->getAuthority());
141  $this->assertEquals('localhost', $uri->getHost());
142  $this->assertEquals(8080, $uri->getPort());
143  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
144  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
145  $this->assertEquals('fragment', $uri->getFragment());
146  }

◆ test_no_authority()

URITest::test_no_authority ( )

test_init

Definition at line 343 of file URITest.php.

343  : void
344  {
345  $this->expectException(TypeError::class);
346  new ILIAS\Data\URI(self::URI_NO_AUTHORITY);
347  }

◆ test_no_path()

URITest::test_no_path ( )

test_init

Definition at line 201 of file URITest.php.

201  : void
202  {
203  $uri = new ILIAS\Data\URI(self::URI_NO_PATH_1);
204  $this->assertEquals('g-it', $uri->getSchema());
205  $this->assertEquals('ilias%2Da.de:8080', $uri->getAuthority());
206  $this->assertEquals('ilias%2Da.de', $uri->getHost());
207  $this->assertEquals('8080', $uri->getPort());
208  $this->assertNull($uri->getPath());
209  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
210  $this->assertEquals('fragment', $uri->getFragment());
211 
212  $uri = new ILIAS\Data\URI(self::URI_NO_PATH_2);
213  $this->assertEquals('g.it', $uri->getSchema());
214  $this->assertEquals('amaz;on.co.uk:8080', $uri->getAuthority());
215  $this->assertEquals('amaz;on.co.uk', $uri->getHost());
216  $this->assertEquals('8080', $uri->getPort());
217  $this->assertNull($uri->getPath());
218  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
219  $this->assertEquals('fragment', $uri->getFragment());
220  }

◆ test_no_query()

URITest::test_no_query ( )

test_init

Definition at line 225 of file URITest.php.

225  : void
226  {
227  $uri = new ILIAS\Data\URI(self::URI_NO_QUERY_1);
228  $this->assertEquals('git', $uri->getSchema());
229  $this->assertEquals('one-letter-top-level.a:8080', $uri->getAuthority());
230  $this->assertEquals('one-letter-top-level.a', $uri->getHost());
231  $this->assertEquals('8080', $uri->getPort());
232  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
233  $this->assertNull($uri->getQuery());
234  $this->assertEquals('fragment', $uri->getFragment());
235 
236  $uri = new ILIAS\Data\URI(self::URI_NO_QUERY_2);
237  $this->assertEquals('git', $uri->getSchema());
238  $this->assertEquals('github.com:8080', $uri->getAuthority());
239  $this->assertEquals('github.com', $uri->getHost());
240  $this->assertEquals('8080', $uri->getPort());
241  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
242  $this->assertNull($uri->getQuery());
243  $this->assertEquals('fragment', $uri->getFragment());
244  }

◆ test_no_schema()

URITest::test_no_schema ( )

test_init

Definition at line 334 of file URITest.php.

334  : void
335  {
336  $this->expectException(TypeError::class);
337  new ILIAS\Data\URI(self::URI_NO_SCHEMA);
338  }

◆ test_path()

URITest::test_path ( )

test_init

Definition at line 302 of file URITest.php.

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

◆ test_realpctenc()

URITest::test_realpctenc ( )

test_init

Definition at line 388 of file URITest.php.

388  : void
389  {
390  $uri = new ILIAS\Data\URI(self::URI_REALPCTENC);
391  $this->assertEquals(self::PATH_REALPCTENC, $uri->getPath());
392  $this->assertEquals(self::PARAMS_REALPCTENC, $uri->getParameters());
393  }

◆ test_uri_invalid()

URITest::test_uri_invalid ( )

test_init

Definition at line 379 of file URITest.php.

379  : void
380  {
381  $this->expectException(InvalidArgumentException::class);
382  new ILIAS\Data\URI(self::URI_INVALID);
383  }

◆ test_with_authority()

URITest::test_with_authority (   $uri)

test_init

Definition at line 598 of file URITest.php.

598  : void
599  {
600  $this->assertEquals('g+it', $uri->getSchema());
601  $this->assertEquals('github.com:8080', $uri->getAuthority());
602  $this->assertEquals('github.com', $uri->getHost());
603  $this->assertEquals('8080', $uri->getPort());
604  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
605  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
606  $this->assertEquals('fragment', $uri->getFragment());
607  $uri = $uri->withAuthority('www1.ilias.de');
608  $this->assertEquals('g+it', $uri->getSchema());
609  $this->assertEquals('www1.ilias.de', $uri->getAuthority());
610  $this->assertEquals('www1.ilias.de', $uri->getHost());
611  $this->assertNull($uri->getPort());
612  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
613  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
614  $this->assertEquals('fragment', $uri->getFragment());
615  $uri = $uri->withAuthority('ilias.de:80');
616  $this->assertEquals('g+it', $uri->getSchema());
617  $this->assertEquals('ilias.de:80', $uri->getAuthority());
618  $this->assertEquals('ilias.de', $uri->getHost());
619  $this->assertEquals('80', $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('a:1');
624  $this->assertEquals('g+it', $uri->getSchema());
625  $this->assertEquals('a:1', $uri->getAuthority());
626  $this->assertEquals('a', $uri->getHost());
627  $this->assertEquals(1, $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('a');
632  $this->assertEquals('g+it', $uri->getSchema());
633  $this->assertEquals('a', $uri->getAuthority());
634  $this->assertEquals('a', $uri->getHost());
635  $this->assertNull($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('1.2.3.4');
640  $this->assertEquals('g+it', $uri->getSchema());
641  $this->assertEquals('1.2.3.4', $uri->getAuthority());
642  $this->assertEquals('1.2.3.4', $uri->getHost());
643  $this->assertNull($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('1.2.3.4:5');
648  $this->assertEquals('g+it', $uri->getSchema());
649  $this->assertEquals('1.2.3.4:5', $uri->getAuthority());
650  $this->assertEquals('1.2.3.4', $uri->getHost());
651  $this->assertEquals(5, $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('localhost1');
656  $this->assertEquals('g+it', $uri->getSchema());
657  $this->assertEquals('localhost1', $uri->getAuthority());
658  $this->assertEquals('localhost1', $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('localhost1:10');
664  $this->assertEquals('g+it', $uri->getSchema());
665  $this->assertEquals('localhost1:10', $uri->getAuthority());
666  $this->assertEquals('localhost1', $uri->getHost());
667  $this->assertEquals(10, $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  }

◆ test_with_authority_invalid_1()

URITest::test_with_authority_invalid_1 ( )

test_with_authority

Definition at line 676 of file URITest.php.

676  : void
677  {
678  $this->expectException(InvalidArgumentException::class);
679  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
680  $uri->withAuthority('-foo-.de');
681  }

◆ test_with_authority_invalid_2()

URITest::test_with_authority_invalid_2 ( )

test_with_authority

Definition at line 686 of file URITest.php.

686  : void
687  {
688  $this->expectException(InvalidArgumentException::class);
689  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
690  $uri->withAuthority('-bar-.de:6060');
691  }

◆ test_with_authority_invalid_3()

URITest::test_with_authority_invalid_3 ( )

test_with_authority

Definition at line 697 of file URITest.php.

697  : void
698  {
699  $this->expectException(InvalidArgumentException::class);
700  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
701  $uri->withHost('ilias.de:');
702  }

◆ test_with_authority_invalid_4()

URITest::test_with_authority_invalid_4 ( )

test_with_authority

Definition at line 707 of file URITest.php.

707  : void
708  {
709  $this->expectException(InvalidArgumentException::class);
710  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
711  $uri->withHost('ilias.de: ');
712  }

◆ test_with_authority_invalid_5()

URITest::test_with_authority_invalid_5 ( )

test_with_authority

Definition at line 717 of file URITest.php.

717  : void
718  {
719  $this->expectException(InvalidArgumentException::class);
720  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
721  $uri->withHost('ilias.de:aaa');
722  }

◆ test_with_authority_invalid_6()

URITest::test_with_authority_invalid_6 ( )

test_with_authority

Definition at line 727 of file URITest.php.

727  : void
728  {
729  $this->expectException(InvalidArgumentException::class);
730  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
731  $uri->withAuthority('foo.de&<script>');
732  }

◆ test_with_authority_invalid_7()

URITest::test_with_authority_invalid_7 ( )

test_with_authority

Definition at line 738 of file URITest.php.

738  : void
739  {
740  $this->expectException(InvalidArgumentException::class);
741  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
742  $uri->withAuthority('foo.de"><script>alert');
743  }

◆ test_with_authority_invalid_8()

URITest::test_with_authority_invalid_8 ( )

test_with_authority

Definition at line 749 of file URITest.php.

749  : void
750  {
751  $this->expectException(InvalidArgumentException::class);
752  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
753  $uri->withAuthority(' :80');
754  }

◆ test_with_fragment()

URITest::test_with_fragment (   $uri)

test_init

Definition at line 869 of file URITest.php.

869  : void
870  {
871  $this->assertEquals('g+it', $uri->getSchema());
872  $this->assertEquals('github.com:8080', $uri->getAuthority());
873  $this->assertEquals('github.com', $uri->getHost());
874  $this->assertEquals('8080', $uri->getPort());
875  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
876  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
877  $this->assertEquals('fragment', $uri->getFragment());
878  $uri = $uri->withFragment('someFragment');
879  $this->assertEquals('g+it', $uri->getSchema());
880  $this->assertEquals('github.com:8080', $uri->getAuthority());
881  $this->assertEquals('github.com', $uri->getHost());
882  $this->assertEquals('8080', $uri->getPort());
883  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
884  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
885  $this->assertEquals('someFragment', $uri->getFragment());
886  $uri = $uri->withFragment();
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->assertNull($uri->getFragment());
894  }

◆ test_with_fragment_invalid_1()

URITest::test_with_fragment_invalid_1 ( )

test_with_fragment

Definition at line 899 of file URITest.php.

899  : void
900  {
901  $this->expectException(InvalidArgumentException::class);
902  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
903  $uri->withFragment('aaa[]');
904  }

◆ test_with_fragment_invalid_2()

URITest::test_with_fragment_invalid_2 ( )

test_with_fragment

Definition at line 909 of file URITest.php.

909  : void
910  {
911  $this->expectException(InvalidArgumentException::class);
912  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
913  $uri->withFragment('script>');
914  }

◆ test_with_host()

URITest::test_with_host (   $uri)

test_init

Definition at line 545 of file URITest.php.

545  : void
546  {
547  $this->assertEquals('g+it', $uri->getSchema());
548  $this->assertEquals('github.com:8080', $uri->getAuthority());
549  $this->assertEquals('github.com', $uri->getHost());
550  $this->assertEquals('8080', $uri->getPort());
551  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
552  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
553  $this->assertEquals('fragment', $uri->getFragment());
554  $uri = $uri->withHost('ilias.de');
555  $this->assertEquals('g+it', $uri->getSchema());
556  $this->assertEquals('ilias.de:8080', $uri->getAuthority());
557  $this->assertEquals('ilias.de', $uri->getHost());
558  $this->assertEquals('8080', $uri->getPort());
559  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
560  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
561  $this->assertEquals('fragment', $uri->getFragment());
562  }

◆ test_with_host_invalid_1()

URITest::test_with_host_invalid_1 ( )

test_with_host

Definition at line 568 of file URITest.php.

568  : void
569  {
570  $this->expectException(InvalidArgumentException::class);
571  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
572  $uri->withHost('-foo-.de');
573  }

◆ test_with_host_invalid_3()

URITest::test_with_host_invalid_3 ( )

test_with_host

Definition at line 578 of file URITest.php.

578  : void
579  {
580  $this->expectException(InvalidArgumentException::class);
581  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
582  $uri->withHost('');
583  }

◆ test_with_host_invalid_4()

URITest::test_with_host_invalid_4 ( )

test_with_host

Definition at line 588 of file URITest.php.

588  : void
589  {
590  $this->expectException(InvalidArgumentException::class);
591  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
592  $uri->withHost('ilias.de"><script');
593  }

◆ test_with_path()

URITest::test_with_path (   $uri)

test_init

Definition at line 759 of file URITest.php.

759  : void
760  {
761  $this->assertEquals('g+it', $uri->getSchema());
762  $this->assertEquals('github.com:8080', $uri->getAuthority());
763  $this->assertEquals('github.com', $uri->getHost());
764  $this->assertEquals('8080', $uri->getPort());
765  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
766  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
767  $this->assertEquals('fragment', $uri->getFragment());
768  $uri = $uri->withPath('a/b');
769  $this->assertEquals('g+it', $uri->getSchema());
770  $this->assertEquals('github.com:8080', $uri->getAuthority());
771  $this->assertEquals('github.com', $uri->getHost());
772  $this->assertEquals('8080', $uri->getPort());
773  $this->assertEquals('a/b', $uri->getPath());
774  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
775  $this->assertEquals('fragment', $uri->getFragment());
776  $uri = $uri->withPath();
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->assertNull($uri->getPath());
782  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
783  $this->assertEquals('fragment', $uri->getFragment());
784  }

◆ test_with_path_invalid_1()

URITest::test_with_path_invalid_1 ( )

test_with_path

Definition at line 789 of file URITest.php.

789  : void
790  {
791  $this->expectException(InvalidArgumentException::class);
792  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
793  $uri->withPath('/<script>/a');
794  }

◆ test_with_path_invalid_2()

URITest::test_with_path_invalid_2 ( )

test_with_path

Definition at line 799 of file URITest.php.

799  : void
800  {
801  $this->expectException(InvalidArgumentException::class);
802  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
803  $uri->withPath('//a/b');
804  }

◆ test_with_path_invalid_3()

URITest::test_with_path_invalid_3 ( )

test_with_path

Definition at line 809 of file URITest.php.

809  : void
810  {
811  $this->expectException(InvalidArgumentException::class);
812  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
813  $uri->withPath(':a/b');
814  }

◆ test_with_port()

URITest::test_with_port (   $uri)

test_init

Definition at line 494 of file URITest.php.

494  : void
495  {
496  $this->assertEquals('g+it', $uri->getSchema());
497  $this->assertEquals('github.com:8080', $uri->getAuthority());
498  $this->assertEquals('github.com', $uri->getHost());
499  $this->assertEquals('8080', $uri->getPort());
500  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
501  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
502  $this->assertEquals('fragment', $uri->getFragment());
503  $uri = $uri->withPort(80);
504  $this->assertEquals('g+it', $uri->getSchema());
505  $this->assertEquals('github.com:80', $uri->getAuthority());
506  $this->assertEquals('github.com', $uri->getHost());
507  $this->assertEquals('80', $uri->getPort());
508  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
509  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
510  $this->assertEquals('fragment', $uri->getFragment());
511  $uri = $uri->withPort();
512  $this->assertEquals('g+it', $uri->getSchema());
513  $this->assertEquals('github.com', $uri->getAuthority());
514  $this->assertEquals('github.com', $uri->getHost());
515  $this->assertNull($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  }

◆ test_with_port_invalid_1()

URITest::test_with_port_invalid_1 ( )

test_with_port

Definition at line 525 of file URITest.php.

525  : void
526  {
527  $this->expectException(TypeError::class);
528  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
529  $uri->withPort('a111');
530  }

◆ test_with_port_invalid_2()

URITest::test_with_port_invalid_2 ( )

test_with_port

Definition at line 535 of file URITest.php.

535  : void
536  {
537  $this->expectException(TypeError::class);
538  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
539  $uri->withPort('foo');
540  }

◆ test_with_query()

URITest::test_with_query (   $uri)

test_init

Definition at line 819 of file URITest.php.

819  : void
820  {
821  $this->assertEquals('g+it', $uri->getSchema());
822  $this->assertEquals('github.com:8080', $uri->getAuthority());
823  $this->assertEquals('github.com', $uri->getHost());
824  $this->assertEquals('8080', $uri->getPort());
825  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
826  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
827  $this->assertEquals('fragment', $uri->getFragment());
828  $uri = $uri->withQuery('query_par_a1=val_a1');
829  $this->assertEquals('g+it', $uri->getSchema());
830  $this->assertEquals('github.com:8080', $uri->getAuthority());
831  $this->assertEquals('github.com', $uri->getHost());
832  $this->assertEquals('8080', $uri->getPort());
833  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
834  $this->assertEquals('query_par_a1=val_a1', $uri->getQuery());
835  $this->assertEquals('fragment', $uri->getFragment());
836  $uri = $uri->withQuery();
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->assertNull($uri->getQuery());
843  $this->assertEquals('fragment', $uri->getFragment());
844  }

◆ test_with_query_invalid_1()

URITest::test_with_query_invalid_1 ( )

test_with_query

Definition at line 849 of file URITest.php.

849  : void
850  {
851  $this->expectException(InvalidArgumentException::class);
852  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
853  $uri->withQuery('<script>a');
854  }

◆ test_with_query_invalid_2()

URITest::test_with_query_invalid_2 ( )

test_with_query

Definition at line 859 of file URITest.php.

859  : void
860  {
861  $this->expectException(InvalidArgumentException::class);
862  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
863  $uri->withQuery('aa[]');
864  }

◆ test_with_schema()

URITest::test_with_schema (   $uri)

test_init

Definition at line 452 of file URITest.php.

452  : void
453  {
454  $this->assertEquals('g+it', $uri->getSchema());
455  $this->assertEquals('github.com:8080', $uri->getAuthority());
456  $this->assertEquals('github.com', $uri->getHost());
457  $this->assertEquals('8080', $uri->getPort());
458  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
459  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
460  $this->assertEquals('fragment', $uri->getFragment());
461  $uri = $uri->withSchema('http');
462  $this->assertEquals('http', $uri->getSchema());
463  $this->assertEquals('github.com:8080', $uri->getAuthority());
464  $this->assertEquals('github.com', $uri->getHost());
465  $this->assertEquals('8080', $uri->getPort());
466  $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
467  $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
468  $this->assertEquals('fragment', $uri->getFragment());
469  }

◆ test_with_schema_invalid_1()

URITest::test_with_schema_invalid_1 ( )

test_with_schema

Definition at line 474 of file URITest.php.

474  : void
475  {
476  $this->expectException(InvalidArgumentException::class);
477  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
478  $uri->withSchema('');
479  }

◆ test_with_schema_invalid_2()

URITest::test_with_schema_invalid_2 ( )

test_with_schema

Definition at line 484 of file URITest.php.

484  : void
485  {
486  $this->expectException(InvalidArgumentException::class);
487  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
488  $uri->withSchema('1aa');
489  }

◆ test_wrong_authority_in_schema_1()

URITest::test_wrong_authority_in_schema_1 ( )

test_init

Definition at line 361 of file URITest.php.

361  : void
362  {
363  $this->expectException(InvalidArgumentException::class);
364  new ILIAS\Data\URI(self::URI_WRONG_AUTHORITY_1);
365  }

◆ test_wrong_authority_in_schema_2()

URITest::test_wrong_authority_in_schema_2 ( )

test_init

Definition at line 370 of file URITest.php.

370  : void
371  {
372  $this->expectException(InvalidArgumentException::class);
373  new ILIAS\Data\URI(self::URI_WRONG_AUTHORITY_2);
374  }

◆ test_wrong_char_in_schema()

URITest::test_wrong_char_in_schema ( )

test_init

Definition at line 352 of file URITest.php.

352  : void
353  {
354  $this->expectException(TypeError::class);
355  new ILIAS\Data\URI(self::URI_WRONG_SCHEMA);
356  }

◆ testAppendParameter()

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

testWithParameters

Definition at line 976 of file URITest.php.

References $params.

976  : void
977  {
978  $params = [
979  'x' => 1, 'y' => 2,
980  'z' => 5
981  ];
982  $uri = $uri->withParameter('z', 5);
983  $this->assertEquals(
984  $params,
985  $uri->getParameters()
986  );
987  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33

◆ testGetParameter()

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

testGetParameters

Definition at line 939 of file URITest.php.

939  : void
940  {
941  $k = array_keys(self::PARAMS)[0];
942  $this->assertEquals(
943  self::PARAMS[$k],
944  $uri->getParameter($k)
945  );
946  }

◆ testGetParameters()

URITest::testGetParameters ( )

Definition at line 925 of file URITest.php.

References $url.

926  {
927  $url = self::URI_BASE . '?' . http_build_query(self::PARAMS);
928  $uri = new ILIAS\Data\URI($url);
929  $this->assertEquals(
930  self::PARAMS,
931  $uri->getParameters()
932  );
933  return $uri;
934  }
$url
Definition: ltiregstart.php:35

◆ testIPv6()

URITest::testIPv6 ( string  $host)

test_init provideIPv6addresses

Definition at line 97 of file URITest.php.

97  : void
98  {
99  $uri = new ILIAS\Data\URI('http://' . $host);
100  $this->assertEquals('http', $uri->getSchema());
101  $this->assertEquals($host, $uri->getAuthority());
102  $this->assertEquals($host, $uri->getHost());
103  $this->assertEquals(null, $uri->getPort());
104  $this->assertEquals(null, $uri->getPath());
105  $this->assertEquals(null, $uri->getQuery());
106  $this->assertEquals(null, $uri->getFragment());
107  }

◆ testSubstituteParameter()

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

testWithParameters

Definition at line 965 of file URITest.php.

965  : void
966  {
967  $uri = $uri->withParameter('x', 5);
968  $this->assertEquals(
969  5,
970  $uri->getParameter('x')
971  );
972  }

◆ testToString()

URITest::testToString ( )

Definition at line 916 of file URITest.php.

916  : void
917  {
918  $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
919  $this->assertEquals(
920  self::URI_COMPLETE,
921  $uri
922  );
923  }

◆ testWithArrayParameters()

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

testGetParameters

Definition at line 992 of file URITest.php.

References $params.

992  : void
993  {
994  $params = ['x' => 1, 'y' => [10, 11, 12]];
995  $uri = $uri->withParameters($params);
996  $this->assertEquals(
997  $params,
998  $uri->getParameters()
999  );
1000  $this->assertEquals(
1001  'git://github.com:8080/someaccount/somerepo/somerepo.git?x=1&y%5B0%5D=10&y%5B1%5D=11&y%5B2%5D=12',
1002  $uri
1003  );
1004  $this->assertEquals(
1005  $params['y'],
1006  $uri->getParameter('y')
1007  );
1008  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33

◆ testWithOutParameters()

URITest::testWithOutParameters ( )

Definition at line 1010 of file URITest.php.

1010  : void
1011  {
1012  $uri = new ILIAS\Data\URI(self::URI_NO_QUERY_2);
1013  $this->assertEquals(
1014  [],
1015  $uri->getParameters()
1016  );
1017 
1018  $this->assertNull($uri->getParameter('y'));
1019 
1020  $this->assertEquals(
1021  self::URI_NO_QUERY_2,
1022  (string) $uri
1023  );
1024  }

◆ testWithParameters()

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

testGetParameters

Definition at line 951 of file URITest.php.

References $params.

952  {
953  $params = ['x' => 1, 'y' => 2];
954  $uri = $uri->withParameters($params);
955  $this->assertEquals(
956  $params,
957  $uri->getParameters()
958  );
959  return $uri;
960  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33

Field Documentation

◆ PARAMS

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

Definition at line 64 of file URITest.php.

◆ PARAMS_REALPCTENC

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

Definition at line 52 of file URITest.php.

◆ PATH_REALPCTENC

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

Definition at line 51 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 28 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 25 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 26 of file URITest.php.

◆ URI_AUTHORITY_ONLY

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

Definition at line 34 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 30 of file URITest.php.

◆ URI_BASE

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

Definition at line 63 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 12 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 14 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 16 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 48 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 57 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 58 of file URITest.php.

◆ URI_HOST_ALPHADIG_START_3

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

Definition at line 59 of file URITest.php.

◆ URI_HOST_ALPHADIG_START_4

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

Definition at line 60 of file URITest.php.

◆ URI_HOST_ALPHADIG_START_5

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

Definition at line 61 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 46 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 38 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 19 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 20 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 22 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 23 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 36 of file URITest.php.

◆ URI_PATH

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

Definition at line 32 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 50 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 42 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 43 of file URITest.php.

◆ URI_WRONG_SCHEMA

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

Definition at line 40 of file URITest.php.


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