remove( [ 'div', 'figure', '.metadata' ] ); $text = $fmt->getText(); $this->assertSame( $expected, $text ); } public function provideExtracts() { // phpcs:ignore Generic.Files.LineLength $dutch = 'Dutch ( Nederlands (helpยทinfo)) is a West Germanic language and the native language of most of the population of the Netherlands'; $tocText = 'Lead
Section text
'; // phpcs:ignore Generic.Files.LineLength $figureText = 'Test 123beforetextaftertext'; 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\nSection 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, ] ]; } }