filterContent();
$html = $formatter->getText();
$this->assertEquals( self::normalize( $expected ), self::normalize( $html ) );
}
private static function normalize( $s ) {
return str_replace( "\n", '',
str_replace( "\r", '', $s ) // "yay" to Windows!
);
}
public function getHtmlData() {
$removeImages = function( HtmlFormatter $f ) {
$f->setRemoveMedia();
};
$removeTags = function( HtmlFormatter $f ) {
$f->remove( array( 'table', '.foo', '#bar', 'div.baz' ) );
};
$flattenSomeStuff = function( HtmlFormatter $f ) {
$f->flatten( array( 's', 'div' ) );
};
$flattenEverything = function( HtmlFormatter $f ) {
$f->flattenAllTags();
};
return array(
// remove images if asked
array(
'',
'',
$removeImages,
),
// basic tag removal
array(
'
foo |