本文整理汇总了PHP中Net_URL2::setAuthority方法的典型用法代码示例。如果您正苦于以下问题:PHP Net_URL2::setAuthority方法的具体用法?PHP Net_URL2::setAuthority怎么用?PHP Net_URL2::setAuthority使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Net_URL2
的用法示例。
在下文中一共展示了Net_URL2::setAuthority方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test20156
/**
* This is a regression test to test that using the
* host-name "0" does work with getAuthority()
*
* It was reported as Bug #20156 on 2013-12-27 22:56 UTC
* that setAuthority() with "0" as host would not work
*
* @covers Net_URL2::setAuthority
* @covers Net_URL2::getAuthority
* @covers Net_URL2::setHost
* @return void
*/
public function test20156()
{
$url = new Net_URL2('http://user:pass@example.com:127/');
$host = '0';
$url->setHost($host);
$this->assertSame('user:pass@0:127', $url->getAuthority());
$url->setHost(false);
$this->assertSame(false, $url->getAuthority());
$url->setAuthority($host);
$this->assertSame($host, $url->getAuthority());
}