remove( [ 'div', 'figure', '.metadata' ] ); $text = $fmt->getText(); $this->assertSame( $expected, $text ); } public function provideExtracts() { // phpcs:ignore Generic.Files.LineLength $dutch = 'Dutch (About this sound Nederlands (helpยทinfo)) is a West Germanic language and the native language of most of the population of the Netherlands'; $tocText = 'Lead
TOC goes here

Section

Section text

'; // phpcs:ignore Generic.Files.LineLength $figureText = 'Test 123beforetext
About this sound
Very loud speaker
aftertext'; return [ [ 'Dutch ( Nederlands ) is a West Germanic language and the native language of ' . 'most of the population of the Netherlands', $dutch, true, ], 'HTML cleanup in HTML mode' => [ "\u{00A0}A & B", "  A & B\r\n", false ], 'HTML cleanup in plain text mode' => [ 'A & B', "  A & B\r\n", true ], [ "qux", 'qux', false, ], [ "qux", 'qux', false, ], [ "quux", 'quux', false, ], [ // Verify that TOC is properly removed (HTML mode) "Lead\n

Section

\n

Section text

", $tocText, false, ], [ // Verify that TOC is properly removed (plain text mode) "Lead\n\n\x01\x021\2\1Section\nSection text", $tocText, true, ], [ // Verify that text in figures is removed (plain) 'Test 123beforetextaftertext', $figureText, true, ], [ // Verify that text in figures is removed (html) 'Test 123beforetextaftertext', $figureText, false, ] ]; } }