本文整理汇总了PHP中TextHelper::urlify方法的典型用法代码示例。如果您正苦于以下问题:PHP TextHelper::urlify方法的具体用法?PHP TextHelper::urlify怎么用?PHP TextHelper::urlify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextHelper
的用法示例。
在下文中一共展示了TextHelper::urlify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUrlify
public function testUrlify()
{
$this->assertEquals("simple-test-case", $this->object->urlify("This is a simple test case"));
$this->assertEquals('jetudie-le-francais', $this->object->urlify(' J\'étudie le français '));
$this->assertEquals('lo-siento-no-hablo-espanol', $this->object->urlify('Lo siento, no hablo español.'));
$this->assertEquals('f3pws', $this->object->urlify('ΦΞΠΏΣ'));
$this->assertEquals('yo-hablo-espanol', $this->object->urlify('¿Yo hablo español?'));
// Test for many rounds with a language, that has no map associated
// This causes a "regular expression is too large" error on old versions
for ($i = 0; $i < 1000; $i++) {
$this->object->urlify('Lo siento, no hablo español.', 60, -1);
}
}
示例2: testUrlify_regexTooLarge
/**
* Test for many rounds with a language, that has no map associated
* This causes a "regular expression is too large" error on old versions
*/
public function testUrlify_regexTooLarge()
{
for ($i = 0; $i < 1000; $i++) {
$this->object->urlify('Lo siento, no hablo español.', 60, -1);
}
}