本文整理汇总了PHP中Net_URL2::removeDotSegments方法的典型用法代码示例。如果您正苦于以下问题:PHP Net_URL2::removeDotSegments方法的具体用法?PHP Net_URL2::removeDotSegments怎么用?PHP Net_URL2::removeDotSegments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Net_URL2
的用法示例。
在下文中一共展示了Net_URL2::removeDotSegments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($path = '', $defaults = array(), $rules = array())
{
$this->path = '/' . trim(Net_URL2::removeDotSegments($path), '/');
$this->setDefaults($defaults);
$this->setRules($rules);
try {
$this->parsePath();
} catch (Exception $e) {
// The path could not be parsed correctly, treat it as fixed
$this->fixed = true;
$part = self::createPart(Net_URL_Mapper_Part::FIXED, $this->path, $this->path);
$this->parts = array($part);
}
$this->getRequired();
}
示例2: test19315
/**
* This is a regression test that removeDotSegments('0') is
* working as it was reported as not-working in Bug #19315
* on 2012-03-04 04:18 UTC.
*
* @return void
*/
public function test19315()
{
$actual = Net_URL2::removeDotSegments('0');
$this->assertSame('0', $actual);
$nonStringObject = (object) array();
try {
Net_URL2::removeDotSegments($nonStringObject);
} catch (PHPUnit_Framework_Error $error) {
$this->addToAssertionCount(1);
}
if (!isset($error)) {
$this->fail('Failed to verify that error was given.');
}
unset($error);
}
示例3: testRemoveDotSegments
/**
* @dataProvider pathProvider
*/
public function testRemoveDotSegments($path, $assertion)
{
$this->assertEquals($assertion, Net_URL2::removeDotSegments($path));
}