HtmlExcerpt.php 683 B

12345678910111213141516171819
  1. <?php
  2. /**
  3. * @group formatting
  4. */
  5. class Tests_Formatting_HtmlExcerpt extends WP_UnitTestCase {
  6. function test_simple() {
  7. $this->assertEquals("Baba", wp_html_excerpt("Baba told me not to come", 4));
  8. }
  9. function test_html() {
  10. $this->assertEquals("Baba", wp_html_excerpt("<a href='http://baba.net/'>Baba</a> told me not to come", 4));
  11. }
  12. function test_entities() {
  13. $this->assertEquals("Baba", wp_html_excerpt("Baba &amp; Dyado", 8));
  14. $this->assertEquals("Baba", wp_html_excerpt("Baba &#038; Dyado", 8));
  15. $this->assertEquals("Baba &amp; D", wp_html_excerpt("Baba &amp; Dyado", 12));
  16. $this->assertEquals("Baba &amp; Dyado", wp_html_excerpt("Baba &amp; Dyado", 100));
  17. }
  18. }