本文整理汇总了PHP中Zend\Uri\Uri::getUserInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Uri::getUserInfo方法的具体用法?PHP Uri::getUserInfo怎么用?PHP Uri::getUserInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Uri\Uri
的用法示例。
在下文中一共展示了Uri::getUserInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetUserInfo
/**
* Test that we get the correct userInfo
*
* @param string $uriString
* @param array $parts
* @dataProvider uriWithPartsProvider
*/
public function testGetUserInfo($uriString, $parts)
{
$uri = new Uri($uriString);
if (isset($parts['userInfo'])) {
$this->assertEquals($parts['userInfo'], $uri->getUserInfo());
} else {
$this->assertNull($uri->getUserInfo());
}
}
示例2: testParseTwice
public function testParseTwice()
{
$uri = new Uri();
$uri->parse('http://user@example.com:1/absolute/url?query#fragment');
$uri->parse('/relative/url');
$this->assertNull($uri->getScheme());
$this->assertNull($uri->getHost());
$this->assertNull($uri->getUserInfo());
$this->assertNull($uri->getPort());
$this->assertNull($uri->getQuery());
$this->assertNull($uri->getFragment());
}
示例3: parse
/**
* @inheritdoc
*/
public function parse($uri)
{
$uri = new Uri($uri);
return $this->formatResults(['scheme' => $uri->getScheme(), 'userinfo' => $uri->getUserInfo(), 'host' => $uri->getHost(), 'port' => $uri->getPort(), 'path' => $uri->getPath(), 'query' => $uri->getQuery(), 'fragment' => $uri->getFragment()]);
}
示例4: getUserInfo
/**
* Get the User-info (usually user:password) part
*
* @return string|null
*/
public function getUserInfo()
{
return $this->uri->getUserInfo();
}