Ejemplo n.º 1
0
 public function testFirstSentence()
 {
     $many = str_repeat('many ', 100);
     $cases = array('<h1>should ignore</h1><p>First sentence. Second sentence.</p>' => 'First sentence.', '<h1>should ignore</h1><p>First Mr. sentence. Second sentence.</p>' => 'First Mr. sentence.', "<h1>should ignore</h1><p>Sentence with {$many}words. Second sentence.</p>" => "Sentence with {$many}words.", '<p>This classic picture book features a repetitive format that lends itself to audience interaction.' . '&nbsp; Illustrator Eric Carle submitted new, bolder artwork for the 25th anniversary edition.</p>' => 'This classic picture book features a repetitive format that lends itself to audience interaction.');
     foreach ($cases as $orig => $match) {
         $textObj = new HTMLText();
         $textObj->setValue($orig);
         $this->assertEquals($match, $textObj->FirstSentence());
     }
 }
Ejemplo n.º 2
0
 function testFirstSentence()
 {
     $many = str_repeat('many ', 100);
     $cases = array('<h1>should ignore</h1><p>First sentence. Second sentence.</p>' => 'First sentence.', '<h1>should ignore</h1><p>First Mr. sentence. Second sentence.</p>' => 'First Mr. sentence.', "<h1>should ignore</h1><p>Sentence with {$many}words. Second sentence.</p>" => "Sentence with {$many}words.");
     foreach ($cases as $orig => $match) {
         $textObj = new HTMLText();
         $textObj->setValue($orig);
         $this->assertEquals($match, $textObj->FirstSentence());
     }
 }