mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51623 602fd350-edb4-49c9-b593-d223f7449a82
20 lines
697 B
PHP
20 lines
697 B
PHP
<?php
|
|
|
|
/**
|
|
* @group formatting
|
|
*/
|
|
class Tests_Formatting_wpHtmlExcerpt extends WP_UnitTestCase {
|
|
function test_simple() {
|
|
$this->assertSame( 'Baba', wp_html_excerpt( 'Baba told me not to come', 4 ) );
|
|
}
|
|
function test_html() {
|
|
$this->assertSame( 'Baba', wp_html_excerpt( "<a href='http://baba.net/'>Baba</a> told me not to come", 4 ) );
|
|
}
|
|
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 ) );
|
|
}
|
|
}
|