8000 [HttpFoundation] renamed hostname to host in the test to be consistent · symfony/symfony@18b9e68 · GitHub
[go: up one dir, main page]

Skip to content

Commit 18b9e68

Browse files
committed
[HttpFoundation] renamed hostname to host in the test to be consistent
1 parent b7614e9 commit 18b9e68

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ public function testGetUri()
303303
$server = array();
304304

305305
// 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
307307

308-
$server['HTTP_HOST'] = 'hostname:8080';
308+
$server['HTTP_HOST'] = 'host:8080';
309309
$server['SERVER_NAME'] = 'servername';
310310
$server['SERVER_PORT'] = '8080';
311311

@@ -321,16 +321,16 @@ public function testGetUri()
321321

322322
$request->initialize(array(), array(), array(), array(), array(), $server);
323323

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');
325325

326326
// Use std port number
327-
$server['HTTP_HOST'] = 'hostname';
327+
$server['HTTP_HOST'] = 'host';
328328
$server['SERVER_NAME'] = 'servername';
329329
$server['SERVER_PORT'] = '80';
330330

331331
$request->initialize(array(), array(), array(), array(), array(), $server);
332332

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');
334334

335335
// Without HOST HEADER
336336
unset($server['HTTP_HOST']);
@@ -344,9 +344,9 @@ public function testGetUri()
344344
// Request with URL REWRITING (hide index.php)
345345
// RewriteCond %{REQUEST_FILENAME} !-f
346346
// RewriteRule ^(.*)$ index.php [QSA,L]
347-
// http://hostname:8080/path/info?query=string
347+
// http://host:8080/path/info?query=string
348348
$server = array();
349-
$server['HTTP_HOST'] = 'hostname:8080';
349+
$server['HTTP_HOST'] = 'host:8080';
350350
$server['SERVER_NAME'] = 'servername';
351351
$server['SERVER_PORT'] = '8080';
352352

@@ -360,17 +360,17 @@ public function testGetUri()
360360
$server['SCRIPT_FILENAME'] = '/some/where/index.php';
361361

362362
$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');
364364

365365
// 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';
368368
$server['SERVER_NAME'] = 'servername';
369369
$server['SERVER_PORT'] = '80';
370370

371371
$request->initialize(array(), array(), array(), array(), array(), $server);
372372

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');
374374

375375
// Without HOST HEADER
376376
unset($server['HTTP_HOST']);
@@ -384,7 +384,7 @@ public function testGetUri()
384384
// With encoded characters
385385

386386
$server = array(
387-
'HTTP_HOST' => 'hostname:8080',
387+
'HTTP_HOST' => 'host:8080',
388388
'SERVER_NAME' => 'servername',
389389
'SERVER_PORT' => '8080',
390390
'QUERY_STRING' => 'query=string',
@@ -398,19 +398,19 @@ public function testGetUri()
398398
$request->initialize(array(), array(), array(), array(), array(), $server);
399399

400400
$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',
402402
$request->getUri()
403403
);
404404

405405
// with user info
406406

407407
$server['PHP_AUTH_USER'] = 'fabien';
408408
$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());
410410

411411
$server['PHP_AUTH_PW'] = 'symfony';
412412
$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());
414414
}
415415

416416
/**
@@ -433,9 +433,9 @@ public function testGetUriForPath()
433433
$server = array();
434434

435435
// 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
437437

438-
$server['HTTP_HOST'] = 'hostname:8080';
438+
$server['HTTP_HOST'] = 'host:8080';
439439
$server['SERVER_NAME'] = 'servername';
440440
$server['SERVER_PORT'] = '8080';
441441

@@ -451,16 +451,16 @@ public function testGetUriForPath()
451451

452452
$request->initialize(array(), array(), array(), array(), array(),$server);
453453

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');
455455

456456
// Use std port number
457-
$server['HTTP_HOST'] = 'hostname';
457+
$server['HTTP_HOST'] = 'host';
458458
$server['SERVER_NAME'] = 'servername';
459459
$server['SERVER_PORT'] = '80';
460460

461461
$request->initialize(array(), array(), array(), array(), array(), $server);
462462

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');
464464

465465
// Without HOST HEADER
466466
unset($server['HTTP_HOST']);
@@ -474,9 +474,9 @@ public function testGetUriForPath()
474474
// Request with URL REWRITING (hide index.php)
475475
// RewriteCond %{REQUEST_FILENAME} !-f
476476
// RewriteRule ^(.*)$ index.php [QSA,L]
477-
// http://hostname:8080/path/info?query=string
477+
// http://host:8080/path/info?query=string
478478
$server = array();
479-
$server['HTTP_HOST'] = 'hostname:8080';
479+
$server['HTTP_HOST'] = 'host:8080';
480480
$server['SERVER_NAME'] = 'servername';
481481
$server['SERVER_PORT'] = '8080';
482482

@@ -490,17 +490,17 @@ public function testGetUriForPath()
490490
$server['SCRIPT_FILENAME'] = '/some/where/index.php';
491491

492492
$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');
494494

495495
// 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';
498498
$server['SERVER_NAME'] = 'servername';
499499
$server['SERVER_PORT'] = '80';
500500

501501
$request->initialize(array(), array(), array(), array(), array(), $server);
502502

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');
504504

505505
// Without HOST HEADER
506506
unset($server['HTTP_HOST']);

0 commit comments

Comments
 (0)
0