@@ -303,9 +303,9 @@ public function testGetUri()
303
303
$ server = array ();
304
304
305
305
// Standard Request on non default PORT
306
- // http://hostname :8080/index.php/path/info?query=string
306
+ // http://host :8080/index.php/path/info?query=string
307
307
308
- $ server ['HTTP_HOST ' ] = 'hostname :8080 ' ;
308
+ $ server ['HTTP_HOST ' ] = 'host :8080 ' ;
309
309
$ server ['SERVER_NAME ' ] = 'servername ' ;
310
310
$ server ['SERVER_PORT ' ] = '8080 ' ;
311
311
@@ -321,16 +321,16 @@ public function testGetUri()
321
321
322
322
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
323
323
324
- $ this ->assertEquals ('http://hostname :8080/index.php/path/info?query=string ' , $ request ->getUri (), '->getUri() with non default port ' );
324
+ $ this ->assertEquals ('http://host :8080/index.php/path/info?query=string ' , $ request ->getUri (), '->getUri() with non default port ' );
325
325
326
326
// Use std port number
327
- $ server ['HTTP_HOST ' ] = 'hostname ' ;
327
+ $ server ['HTTP_HOST ' ] = 'host ' ;
328
328
$ server ['SERVER_NAME ' ] = 'servername ' ;
329
329
$ server ['SERVER_PORT ' ] = '80 ' ;
330
330
331
331
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
332
332
333
- $ this ->assertEquals ('http://hostname /index.php/path/info?query=string ' , $ request ->getUri (), '->getUri() with default port ' );
333
+ $ this ->assertEquals ('http://host /index.php/path/info?query=string ' , $ request ->getUri (), '->getUri() with default port ' );
334
334
335
335
// Without HOST HEADER
336
336
unset($ server ['HTTP_HOST ' ]);
@@ -344,9 +344,9 @@ public function testGetUri()
344
344
// Request with URL REWRITING (hide index.php)
345
345
// RewriteCond %{REQUEST_FILENAME} !-f
346
346
// RewriteRule ^(.*)$ index.php [QSA,L]
347
- // http://hostname :8080/path/info?query=string
347
+ // http://host :8080/path/info?query=string
348
348
$ server = array ();
349
- $ server ['HTTP_HOST ' ] = 'hostname :8080 ' ;
349
+ $ server ['HTTP_HOST ' ] = 'host :8080 ' ;
350
350
$ server ['SERVER_NAME ' ] = 'servername ' ;
351
351
$ server ['SERVER_PORT ' ] = '8080 ' ;
352
352
@@ -360,17 +360,17 @@ public function testGetUri()
360
360
$ server ['SCRIPT_FILENAME ' ] = '/some/where/index.php ' ;
361
361
362
362
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
363
- $ this ->assertEquals ('http://hostname :8080/path/info?query=string ' , $ request ->getUri (), '->getUri() with rewrite ' );
363
+ $ this ->assertEquals ('http://host :8080/path/info?query=string ' , $ request ->getUri (), '->getUri() with rewrite ' );
364
364
365
365
// Use std port number
366
- // http://hostname /path/info?query=string
367
- $ server ['HTTP_HOST ' ] = 'hostname ' ;
366
+ // http://host /path/info?query=string
367
+ $ server ['HTTP_HOST ' ] = 'host ' ;
368
368
$ server ['SERVER_NAME ' ] = 'servername ' ;
369
369
$ server ['SERVER_PORT ' ] = '80 ' ;
370
370
371
371
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
372
372
373
- $ this ->assertEquals ('http://hostname /path/info?query=string ' , $ request ->getUri (), '->getUri() with rewrite and default port ' );
373
+ $ this ->assertEquals ('http://host /path/info?query=string ' , $ request ->getUri (), '->getUri() with rewrite and default port ' );
374
374
375
375
// Without HOST HEADER
376
376
unset($ server ['HTTP_HOST ' ]);
@@ -384,7 +384,7 @@ public function testGetUri()
384
384
// With encoded characters
385
385
386
386
$ server = array (
387
- 'HTTP_HOST ' => 'hostname :8080 ' ,
387
+ 'HTTP_HOST ' => 'host :8080 ' ,
388
388
'SERVER_NAME ' => 'servername ' ,
389
389
'SERVER_PORT ' => '8080 ' ,
390
390
'QUERY_STRING ' => 'query=string ' ,
@@ -398,19 +398,19 @@ public function testGetUri()
398
398
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
399
399
400
400
$ this ->assertEquals (
401
- 'http://hostname :8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string ' ,
401
+ 'http://host :8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string ' ,
402
402
$ request ->getUri ()
403
403
);
404
404
405
405
// with user info
406
406
407
407
$ server ['PHP_AUTH_USER ' ] = 'fabien ' ;
408
408
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
409
- $ this ->assertEquals ('http://hostname :8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string ' , $ request ->getUri ());
409
+ $ this ->assertEquals ('http://host :8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string ' , $ request ->getUri ());
410
410
411
411
$ server ['PHP_AUTH_PW ' ] = 'symfony ' ;
412
412
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
413
- $ this ->assertEquals ('http://hostname :8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string ' , $ request ->getUri ());
413
+ $ this ->assertEquals ('http://host :8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string ' , $ request ->getUri ());
414
414
}
415
415
416
416
/**
@@ -433,9 +433,9 @@ public function testGetUriForPath()
433
433
$ server = array ();
434
434
435
435
// Standard Request on non default PORT
436
- // http://hostname :8080/index.php/path/info?query=string
436
+ // http://host :8080/index.php/path/info?query=string
437
437
438
- $ server ['HTTP_HOST ' ] = 'hostname :8080 ' ;
438
+ $ server ['HTTP_HOST ' ] = 'host :8080 ' ;
439
439
$ server ['SERVER_NAME ' ] = 'servername ' ;
440
440
$ server ['SERVER_PORT ' ] = '8080 ' ;
441
441
@@ -451,16 +451,16 @@ public function testGetUriForPath()
451
451
452
452
$ request ->initialize (array (), array (), array (), array (), array (),$ server );
453
453
454
- $ this ->assertEquals ('http://hostname :8080/index.php/some/path ' , $ request ->getUriForPath ('/some/path ' ), '->getUriForPath() with non default port ' );
454
+ $ this ->assertEquals ('http://host :8080/index.php/some/path ' , $ request ->getUriForPath ('/some/path ' ), '->getUriForPath() with non default port ' );
455
455
456
456
// Use std port number
457
- $ server ['HTTP_HOST ' ] = 'hostname ' ;
457
+ $ server ['HTTP_HOST ' ] = 'host ' ;
458
458
$ server ['SERVER_NAME ' ] = 'servername ' ;
459
459
$ server ['SERVER_PORT ' ] = '80 ' ;
460
460
461
461
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
462
462
463
- $ this ->assertEquals ('http://hostname /index.php/some/path ' , $ request ->getUriForPath ('/some/path ' ), '->getUriForPath() with default port ' );
463
+ $ this ->assertEquals ('http://host /index.php/some/path ' , $ request ->getUriForPath ('/some/path ' ), '->getUriForPath() with default port ' );
464
464
465
465
// Without HOST HEADER
466
466
unset($ server ['HTTP_HOST ' ]);
@@ -474,9 +474,9 @@ public function testGetUriForPath()
474
474
// Request with URL REWRITING (hide index.php)
475
475
// RewriteCond %{REQUEST_FILENAME} !-f
476
476
// RewriteRule ^(.*)$ index.php [QSA,L]
477
- // http://hostname :8080/path/info?query=string
477
+ // http://host :8080/path/info?query=string
478
478
$ server = array ();
479
- $ server ['HTTP_HOST ' ] = 'hostname :8080 ' ;
479
+ $ server ['HTTP_HOST ' ] = 'host :8080 ' ;
480
480
$ server ['SERVER_NAME ' ] = 'servername ' ;
481
481
$ server ['SERVER_PORT ' ] = '8080 ' ;
482
482
@@ -490,17 +490,17 @@ public function testGetUriForPath()
490
490
$ server ['SCRIPT_FILENAME ' ] = '/some/where/index.php ' ;
491
491
492
492
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
493
- $ this ->assertEquals ('http://hostname :8080/some/path ' , $ request ->getUriForPath ('/some/path ' ), '->getUri() with rewrite ' );
493
+ $ this ->assertEquals ('http://host :8080/some/path ' , $ request ->getUriForPath ('/some/path ' ), '->getUri() with rewrite ' );
494
494
495
495
// Use std port number
496
- // http://hostname /path/info?query=string
497
- $ server ['HTTP_HOST ' ] = 'hostname ' ;
496
+ // http://host /path/info?query=string
497
+ $ server ['HTTP_HOST ' ] = 'host ' ;
498
498
$ server ['SERVER_NAME ' ] = 'servername ' ;
499
499
$ server ['SERVER_PORT ' ] = '80 ' ;
500
500
501
501
$ request ->initialize (array (), array (), array (), array (), array (), $ server );
502
502
503
- $ this ->assertEquals ('http://hostname /some/path ' , $ request ->getUriForPath ('/some/path ' ), '->getUriForPath() with rewrite and default port ' );
503
+ $ this ->assertEquals ('http://host /some/path ' , $ request ->getUriForPath ('/some/path ' ), '->getUriForPath() with rewrite and default port ' );
504
504
505
505
// Without HOST HEADER
506
506
unset($ server ['HTTP_HOST ' ]);
0 commit comments