コード例 #1
0
 public function testShortenTextWord()
 {
     $this->assertEquals("This is a simple test...", $this->object->shortenTextWord("This is a simple test case", 24, "..."));
     $this->assertEquals("This is a simple test etc", $this->object->shortenTextWord("This is a simple test case", 22, " etc"));
     $this->assertEquals("This is a simple test.", $this->object->shortenTextWord("This is a simple test case", 21, "."));
     $this->assertEquals("The quick brown fox jumps over the lazy dog", $this->object->shortenTextWord("The quick brown fox jumps over the lazy dog"));
     $this->assertEquals("The lazy fox jumps over the quick brown dog", $this->object->shortenTextWord("The lazy fox jumps over the quick brown dog", 0));
     $this->assertEquals("This_is_a_simple_test_ca…", $this->object->shortenTextWord("This_is_a_simple_test_case", 24, "…"));
 }
コード例 #2
0
ファイル: TextTest.php プロジェクト: ceko/concrete5-1
 /**
  * @dataProvider shortenDataProvider
  */
 public function testShortenTextWord($expected, $input1, $input2, $input3)
 {
     $this->assertEquals($expected, $this->object->shortenTextWord($input1, $input2, $input3));
 }