本文整理汇总了PHP中SimpleDumper::clipString方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleDumper::clipString方法的具体用法?PHP SimpleDumper::clipString怎么用?PHP SimpleDumper::clipString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleDumper
的用法示例。
在下文中一共展示了SimpleDumper::clipString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testClipping
public function testClipping()
{
$dumper = new SimpleDumper();
$this->assertEqual($dumper->clipString("Hello", 6), "Hello", "Hello, 6->%s");
$this->assertEqual($dumper->clipString("Hello", 5), "Hello", "Hello, 5->%s");
$this->assertEqual($dumper->clipString("Hello world", 3), "Hel...", "Hello world, 3->%s");
$this->assertEqual($dumper->clipString("Hello world", 6, 3), "Hello ...", "Hello world, 6, 3->%s");
$this->assertEqual($dumper->clipString("Hello world", 3, 6), "...o w...", "Hello world, 3, 6->%s");
$this->assertEqual($dumper->clipString("Hello world", 4, 11), "...orld", "Hello world, 4, 11->%s");
$this->assertEqual($dumper->clipString("Hello world", 4, 12), "...orld", "Hello world, 4, 12->%s");
}