mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
WordPress' code just... wasn't. This is now dealt with. Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS. Fixes #41057. git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
20 lines
707 B
PHP
20 lines
707 B
PHP
<?php
|
|
|
|
/**
|
|
* @group formatting
|
|
*/
|
|
class Tests_Formatting_HtmlExcerpt extends WP_UnitTestCase {
|
|
function test_simple() {
|
|
$this->assertEquals( 'Baba', wp_html_excerpt( 'Baba told me not to come', 4 ) );
|
|
}
|
|
function test_html() {
|
|
$this->assertEquals( 'Baba', wp_html_excerpt( "<a href='http://baba.net/'>Baba</a> told me not to come", 4 ) );
|
|
}
|
|
function test_entities() {
|
|
$this->assertEquals( 'Baba', wp_html_excerpt( 'Baba & Dyado', 8 ) );
|
|
$this->assertEquals( 'Baba', wp_html_excerpt( 'Baba & Dyado', 8 ) );
|
|
$this->assertEquals( 'Baba & D', wp_html_excerpt( 'Baba & Dyado', 12 ) );
|
|
$this->assertEquals( 'Baba & Dyado', wp_html_excerpt( 'Baba & Dyado', 100 ) );
|
|
}
|
|
}
|