Test Uri::host()

This commit is contained in:
Flavio Copes
2016-01-19 11:37:35 +01:00
parent 7813d18b1b
commit 4dd57daec0

View File

@@ -256,6 +256,18 @@ class UriTest extends \Codeception\TestCase\Test
$this->assertsame($uri->extension(), 'foo');
}
public function testHost()
{
$uri = $this->getURI();
$uri->initializeWithURL('http://localhost/a-page')->init();
$this->assertsame($uri->host(), 'localhost');
$uri->initializeWithURL('http://localhost/')->init();
$this->assertsame($uri->host(), 'localhost');
//Host is set to localhost when running from local
$uri->initializeWithURL('http://google.com/')->init();
$this->assertsame($uri->host(), 'localhost');
}