mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
- Add and update @covers tags. - Add and improve docs and inline comments. Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@53562 602fd350-edb4-49c9-b593-d223f7449a82
22 lines
750 B
PHP
22 lines
750 B
PHP
<?php
|
|
|
|
/**
|
|
* @group formatting
|
|
*
|
|
* @covers ::wp_html_excerpt
|
|
*/
|
|
class Tests_Formatting_wpHtmlExcerpt extends WP_UnitTestCase {
|
|
public function test_simple() {
|
|
$this->assertSame( 'Baba', wp_html_excerpt( 'Baba told me not to come', 4 ) );
|
|
}
|
|
public function test_html() {
|
|
$this->assertSame( 'Baba', wp_html_excerpt( "<a href='http://baba.net/'>Baba</a> told me not to come", 4 ) );
|
|
}
|
|
public function test_entities() {
|
|
$this->assertSame( 'Baba', wp_html_excerpt( 'Baba & Dyado', 8 ) );
|
|
$this->assertSame( 'Baba', wp_html_excerpt( 'Baba & Dyado', 8 ) );
|
|
$this->assertSame( 'Baba & D', wp_html_excerpt( 'Baba & Dyado', 12 ) );
|
|
$this->assertSame( 'Baba & Dyado', wp_html_excerpt( 'Baba & Dyado', 100 ) );
|
|
}
|
|
}
|