|
|
@@ -354,7 +354,7 @@ class TextHelperTest extends CakeTestCase {
|
|
|
public function testExcerpt() {
|
|
|
$text = 'This is a phrase with test text to play with';
|
|
|
|
|
|
- $expected = '...with test text...';
|
|
|
+ $expected = '...ase with test text to ...';
|
|
|
$result = $this->Text->excerpt($text, 'test', 9, '...');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
|
|
|
@@ -370,18 +370,19 @@ class TextHelperTest extends CakeTestCase {
|
|
|
$result = $this->Text->excerpt($text, null, 200, '...');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
|
|
|
- $expected = '...phrase...';
|
|
|
+ $expected = '...a phrase w...';
|
|
|
$result = $this->Text->excerpt($text, 'phrase', 2, '...');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
|
|
|
- $phrase = 'This is a phrase with test';
|
|
|
+ $phrase = 'This is a phrase with test text';
|
|
|
$expected = $text;
|
|
|
- $result = $this->Text->excerpt($text, $phrase, strlen($phrase) + 3, '...');
|
|
|
+ $result = $this->Text->excerpt($text, $phrase, 13, '...');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
-
|
|
|
- $phrase = 'This is a phrase with text';
|
|
|
- $expected = $text;
|
|
|
- $result = $this->Text->excerpt($text, $phrase, 10, '...');
|
|
|
+
|
|
|
+ $text = 'aaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaa';
|
|
|
+ $phrase = 'bbbbbbbb';
|
|
|
+ $result = $this->Text->excerpt($text, $phrase, 10);
|
|
|
+ $expected = '...aaaaaaaaaabbbbbbbbaaaaaaaaaa...';
|
|
|
$this->assertEquals($expected, $result);
|
|
|
}
|
|
|
|
|
|
@@ -393,7 +394,7 @@ class TextHelperTest extends CakeTestCase {
|
|
|
public function testExcerptCaseInsensitivity() {
|
|
|
$text = 'This is a phrase with test text to play with';
|
|
|
|
|
|
- $expected = '...with test text...';
|
|
|
+ $expected = '...ase with test text to ...';
|
|
|
$result = $this->Text->excerpt($text, 'TEST', 9, '...');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
|