mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Add R\F\URL::getCurrentDomain()
This commit is contained in:
parent
5f47ddeb53
commit
8a012a5847
3 changed files with 38 additions and 3 deletions
|
|
@ -41,6 +41,25 @@ class URLTest extends \Codeception\Test\Unit
|
|||
$_SERVER['REQUEST_URI'] = $old_request_uri;
|
||||
}
|
||||
|
||||
public function testGetCurrentDomain()
|
||||
{
|
||||
$original_host = $_SERVER['HTTP_HOST'];
|
||||
|
||||
$_SERVER['HTTP_HOST'] = 'rhymix.org';
|
||||
$this->assertEquals('rhymix.org', Rhymix\Framework\URL::getCurrentDomain());
|
||||
$this->assertEquals('rhymix.org', Rhymix\Framework\URL::getCurrentDomain(true));
|
||||
|
||||
$_SERVER['HTTP_HOST'] = 'xn--oi2b48fl0g0pf.RHYMIX.ORG:443';
|
||||
$this->assertEquals('라이믹스.rhymix.org', Rhymix\Framework\URL::getCurrentDomain());
|
||||
$this->assertEquals('라이믹스.rhymix.org:443', Rhymix\Framework\URL::getCurrentDomain(true));
|
||||
|
||||
$_SERVER['HTTP_HOST'] = 'rhymix.org:8080';
|
||||
$this->assertEquals('rhymix.org', Rhymix\Framework\URL::getCurrentDomain());
|
||||
$this->assertEquals('rhymix.org:8080', Rhymix\Framework\URL::getCurrentDomain(true));
|
||||
|
||||
$_SERVER['HTTP_HOST'] = $original_host;
|
||||
}
|
||||
|
||||
public function testGetCurrentDomainURL()
|
||||
{
|
||||
$this->assertEquals('https://www.rhymix.org/', Rhymix\Framework\URL::getCurrentDomainURL());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue