We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like PHP_Typography_Test often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use PHP_Typography_Test, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 83 | class PHP_Typography_Test extends PHP_Typography_Testcase { |
||
| 84 | |||
| 85 | /** |
||
| 86 | * The PHP_Typography instance. |
||
| 87 | * |
||
| 88 | * @var PHP_Typography |
||
| 89 | */ |
||
| 90 | protected $typo; |
||
| 91 | |||
| 92 | /** |
||
| 93 | * The Settings instance. |
||
| 94 | * |
||
| 95 | * @var Settings |
||
| 96 | */ |
||
| 97 | protected $s; |
||
| 98 | |||
| 99 | /** |
||
| 100 | * Sets up the fixture, for example, opens a network connection. |
||
| 101 | * This method is called before a test is executed. |
||
| 102 | */ |
||
| 103 | protected function setUp() { // @codingStandardsIgnoreLine |
||
| 107 | |||
| 108 | /** |
||
| 109 | * Tears down the fixture, for example, closes a network connection. |
||
| 110 | * This method is called after a test is executed. |
||
| 111 | */ |
||
| 112 | protected function tearDown() { // @codingStandardsIgnoreLine |
||
| 114 | |||
| 115 | /** |
||
| 116 | * Test set_tags_to_ignore. |
||
| 117 | * |
||
| 118 | * @coversNothing |
||
| 119 | * |
||
| 120 | * @uses PHP_Typography\Text_Parser |
||
| 121 | * @uses PHP_Typography\Text_Parser\Token |
||
| 122 | */ |
||
| 123 | public function test_set_tags_to_ignore() { |
||
| 200 | |||
| 201 | /** |
||
| 202 | * Test set_classes_to_ignore. |
||
| 203 | * |
||
| 204 | * @coversNothing |
||
| 205 | * |
||
| 206 | * @uses PHP_Typography\Text_Parser |
||
| 207 | * @uses PHP_Typography\Text_Parser\Token |
||
| 208 | */ |
||
| 209 | View Code Duplication | public function test_set_classes_to_ignore() { |
|
| 226 | |||
| 227 | /** |
||
| 228 | * Test set_ids_to_ignore. |
||
| 229 | * |
||
| 230 | * @coversNothing |
||
| 231 | * |
||
| 232 | * @uses PHP_Typography\Text_Parser |
||
| 233 | * @uses PHP_Typography\Text_Parser\Token |
||
| 234 | */ |
||
| 235 | View Code Duplication | public function test_set_ids_to_ignore() { |
|
| 252 | |||
| 253 | /** |
||
| 254 | * Integrate all three "ignore" variants. |
||
| 255 | * |
||
| 256 | * @covers ::query_tags_to_ignore |
||
| 257 | * |
||
| 258 | * @depends test_set_ids_to_ignore |
||
| 259 | * @depends test_set_classes_to_ignore |
||
| 260 | * @depends test_set_tags_to_ignore |
||
| 261 | * |
||
| 262 | * @uses PHP_Typography\Text_Parser |
||
| 263 | * @uses PHP_Typography\Text_Parser\Token |
||
| 264 | */ |
||
| 265 | public function test_complete_ignore() { |
||
| 281 | |||
| 282 | /** |
||
| 283 | * Tests register_node_fix. |
||
| 284 | * |
||
| 285 | * @covers ::register_node_fix |
||
| 286 | */ |
||
| 287 | public function test_register_node_fix() { |
||
| 297 | |||
| 298 | /** |
||
| 299 | * Tests register_node_fix. |
||
| 300 | * |
||
| 301 | * @covers ::register_node_fix |
||
| 302 | * |
||
| 303 | * @expectedException \InvalidArgumentException |
||
| 304 | * @expectedExceptionMessageRegExp /^Invalid fixer group .+\.$/ |
||
| 305 | */ |
||
| 306 | public function test_register_node_fix_invalid_group() { |
||
| 314 | |||
| 315 | /** |
||
| 316 | * Tests register_token_fix. |
||
| 317 | * |
||
| 318 | * @covers ::register_token_fix |
||
| 319 | */ |
||
| 320 | View Code Duplication | public function test_register_token_fix() { |
|
| 330 | |||
| 331 | |||
| 332 | /** |
||
| 333 | * Test get_hyphenation_languages. |
||
| 334 | * |
||
| 335 | * @covers ::get_hyphenation_languages |
||
| 336 | * @covers ::get_language_plugin_list |
||
| 337 | */ |
||
| 338 | public function test_get_hyphenation_languages() { |
||
| 403 | |||
| 404 | |||
| 405 | /** |
||
| 406 | * Test get_diacritic_languages. |
||
| 407 | * |
||
| 408 | * @covers ::get_diacritic_languages |
||
| 409 | * @covers ::get_language_plugin_list |
||
| 410 | */ |
||
| 411 | public function test_get_diacritic_languages() { |
||
| 457 | |||
| 458 | /** |
||
| 459 | * Provide data for testing the complete processing. |
||
| 460 | * |
||
| 461 | * @return array |
||
| 462 | */ |
||
| 463 | public function provide_process_data() { |
||
| 500 | |||
| 501 | |||
| 502 | /** |
||
| 503 | * Test process. |
||
| 504 | * |
||
| 505 | * @covers ::process |
||
| 506 | * @covers ::apply_fixes_to_html_node |
||
| 507 | * |
||
| 508 | * @uses ::process_textnodes |
||
| 509 | * @uses PHP_Typography\Hyphenator |
||
| 510 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 511 | * @uses PHP_Typography\Text_Parser |
||
| 512 | * @uses PHP_Typography\Text_Parser\Token |
||
| 513 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 514 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 515 | * |
||
| 516 | * @dataProvider provide_process_data |
||
| 517 | * |
||
| 518 | * @param string $html HTML input. |
||
| 519 | * @param string $result Entity-escaped output. |
||
| 520 | * @param bool $feed Use process_feed. |
||
| 521 | */ |
||
| 522 | public function test_process( $html, $result, $feed ) { |
||
| 528 | |||
| 529 | |||
| 530 | /** |
||
| 531 | * Test process_feed. |
||
| 532 | * |
||
| 533 | * @covers ::process_feed |
||
| 534 | * @covers ::apply_fixes_to_feed_node |
||
| 535 | * |
||
| 536 | * @uses ::process_textnodes |
||
| 537 | * @uses PHP_Typography\Hyphenator |
||
| 538 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 539 | * @uses PHP_Typography\Text_Parser |
||
| 540 | * @uses PHP_Typography\Text_Parser\Token |
||
| 541 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 542 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 543 | * |
||
| 544 | * @dataProvider provide_process_data |
||
| 545 | * |
||
| 546 | * @param string $html HTML input. |
||
| 547 | * @param string $result Entity-escaped output. |
||
| 548 | * @param bool|string $feed Use process_feed. If $feed is a string, use instead of $result. |
||
| 549 | */ |
||
| 550 | public function test_process_feed( $html, $result, $feed ) { |
||
| 562 | |||
| 563 | /** |
||
| 564 | * Test process_textnodes. |
||
| 565 | * |
||
| 566 | * @covers ::process_textnodes |
||
| 567 | * |
||
| 568 | * @uses PHP_Typography\Hyphenator |
||
| 569 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 570 | * @uses PHP_Typography\Text_Parser |
||
| 571 | * @uses PHP_Typography\Text_Parser\Token |
||
| 572 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 573 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 574 | * |
||
| 575 | * @dataProvider provide_process_data |
||
| 576 | * |
||
| 577 | * @param string $html HTML input. |
||
| 578 | * @param string $result Entity-escaped output. |
||
| 579 | * @param bool|string $feed Use process_feed. If $feed is a string, use instead of $result. |
||
| 580 | */ |
||
| 581 | View Code Duplication | public function test_process_textnodes( $html, $result, $feed ) { |
|
| 588 | |||
| 589 | /** |
||
| 590 | * Provide invalid data for testing process_textnodes. |
||
| 591 | * |
||
| 592 | * @return array |
||
| 593 | */ |
||
| 594 | public function provide_process_textnodes_invalid_html_data() { |
||
| 600 | |||
| 601 | |||
| 602 | /** |
||
| 603 | * Test process_textnodes with invalid HTML. |
||
| 604 | * |
||
| 605 | * @covers ::process_textnodes |
||
| 606 | * |
||
| 607 | * @uses PHP_Typography\Hyphenator |
||
| 608 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 609 | * @uses PHP_Typography\Text_Parser |
||
| 610 | * @uses PHP_Typography\Text_Parser\Token |
||
| 611 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 612 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 613 | * |
||
| 614 | * @dataProvider provide_process_textnodes_invalid_html_data |
||
| 615 | * |
||
| 616 | * @param string $html HTML input. |
||
| 617 | * @param string $feed Ignored. |
||
| 618 | */ |
||
| 619 | View Code Duplication | public function test_process_textnodes_invalid_html( $html, $feed ) { |
|
| 627 | |||
| 628 | |||
| 629 | /** |
||
| 630 | * Test process_textnodes without a fixer instance. |
||
| 631 | * |
||
| 632 | * @covers ::process_textnodes |
||
| 633 | * |
||
| 634 | * @uses PHP_Typography\Hyphenator |
||
| 635 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 636 | * @uses PHP_Typography\Text_Parser |
||
| 637 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 638 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 639 | * |
||
| 640 | * @expectedException \TypeError |
||
| 641 | * |
||
| 642 | * @dataProvider provide_process_data |
||
| 643 | * |
||
| 644 | * @param string $html HTML input. |
||
| 645 | * @param string $result Ignored. |
||
| 646 | * @param bool|string $feed Ignored. |
||
| 647 | */ |
||
| 648 | public function test_process_textnodes_no_fixer( $html, $result, $feed ) { |
||
| 654 | |||
| 655 | /** |
||
| 656 | * Test process_textnodes with alternate settings for titles. |
||
| 657 | * |
||
| 658 | * @covers ::process_textnodes |
||
| 659 | * |
||
| 660 | * @uses PHP_Typography\Hyphenator |
||
| 661 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 662 | * @uses PHP_Typography\Text_Parser |
||
| 663 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 664 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 665 | * |
||
| 666 | * @dataProvider provide_process_data |
||
| 667 | * |
||
| 668 | * @param string $html HTML input. |
||
| 669 | * @param string $result Ignored. |
||
| 670 | * @param bool|string $feed Ignored. |
||
| 671 | */ |
||
| 672 | public function test_process_textnodes_alternate_settings_title( $html, $result, $feed ) { |
||
| 679 | |||
| 680 | |||
| 681 | /** |
||
| 682 | * Provide data for testing process with $is_title set to true. |
||
| 683 | * |
||
| 684 | * @return array |
||
| 685 | */ |
||
| 686 | public function provide_process_with_title_data() { |
||
| 692 | |||
| 693 | |||
| 694 | /** |
||
| 695 | * Test process. |
||
| 696 | * |
||
| 697 | * @covers ::process |
||
| 698 | * |
||
| 699 | * @uses PHP_Typography\Hyphenator |
||
| 700 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 701 | * @uses PHP_Typography\Text_Parser |
||
| 702 | * @uses PHP_Typography\Text_Parser\Token |
||
| 703 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 704 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 705 | * |
||
| 706 | * @dataProvider provide_process_with_title_data |
||
| 707 | * |
||
| 708 | * @param string $html HTML input. |
||
| 709 | * @param string $result Expected entity-escaped result. |
||
| 710 | * @param bool|string $feed Ignored. |
||
| 711 | * @param array $skip_tags Tags to skip. |
||
| 712 | */ |
||
| 713 | public function test_process_with_title( $html, $result, $feed, $skip_tags ) { |
||
| 721 | |||
| 722 | |||
| 723 | /** |
||
| 724 | * Test process_feed. |
||
| 725 | * |
||
| 726 | * @covers ::process_feed |
||
| 727 | * |
||
| 728 | * @uses PHP_Typography\Hyphenator |
||
| 729 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 730 | * @uses PHP_Typography\Text_Parser |
||
| 731 | * @uses PHP_Typography\Text_Parser\Token |
||
| 732 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 733 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 734 | * |
||
| 735 | * @dataProvider provide_process_with_title_data |
||
| 736 | * |
||
| 737 | * @param string $html HTML input. |
||
| 738 | * @param string $result Expected entity-escaped result. |
||
| 739 | * @param bool|string $feed Whether process_feed should be used. If string, use instead of $result. |
||
| 740 | * @param array $skip_tags Tags to skip. |
||
| 741 | */ |
||
| 742 | public function test_process_feed_with_title( $html, $result, $feed, $skip_tags ) { |
||
| 756 | |||
| 757 | /** |
||
| 758 | * Provide data for testing handle_parsing_errors. |
||
| 759 | * |
||
| 760 | * @return [ $errno, $errstr, $errfile, $errline, $errcontext, $result ] |
||
| 761 | */ |
||
| 762 | public function provide_handle_parsing_errors() { |
||
| 770 | |||
| 771 | /** |
||
| 772 | * Test handle_parsing_errors. |
||
| 773 | * |
||
| 774 | * @covers ::handle_parsing_errors |
||
| 775 | * |
||
| 776 | * @dataProvider provide_handle_parsing_errors |
||
| 777 | * |
||
| 778 | * @param int $errno Error type constant. |
||
| 779 | * @param string $errstr Error message. |
||
| 780 | * @param string $errfile File path. |
||
| 781 | * @param string $errline Line number. |
||
| 782 | * @param array $errcontext Stack context. |
||
| 783 | * @param bool $result The expected result. |
||
| 784 | */ |
||
| 785 | public function test_handle_parsing_errors( $errno, $errstr, $errfile, $errline, $errcontext, $result ) { |
||
| 798 | |||
| 799 | /** |
||
| 800 | * Provide data for testing smart_quotes. |
||
| 801 | * |
||
| 802 | * @return array |
||
| 803 | */ |
||
| 804 | public function provide_smart_quotes_data() { |
||
| 822 | |||
| 823 | /** |
||
| 824 | * Test smart_quotes. |
||
| 825 | * |
||
| 826 | * @coversNothing |
||
| 827 | * |
||
| 828 | * @uses PHP_Typography\Text_Parser |
||
| 829 | * @uses PHP_Typography\Text_Parser\Token |
||
| 830 | * |
||
| 831 | * @dataProvider provide_smart_quotes_data |
||
| 832 | * |
||
| 833 | * @param string $html HTML input. |
||
| 834 | * @param string $result Entity-escaped result string. |
||
| 835 | */ |
||
| 836 | public function test_smart_quotes( $html, $result ) { |
||
| 841 | |||
| 842 | |||
| 843 | /** |
||
| 844 | * Test smart_quotes. |
||
| 845 | * |
||
| 846 | * @coversNothing |
||
| 847 | * |
||
| 848 | * @uses PHP_Typography\Text_Parser |
||
| 849 | * @uses PHP_Typography\Text_Parser\Token |
||
| 850 | * |
||
| 851 | * @dataProvider provide_smart_quotes_data |
||
| 852 | * |
||
| 853 | * @param string $html HTML input. |
||
| 854 | * @param string $result Entity-escaped result string. |
||
| 855 | */ |
||
| 856 | public function test_smart_quotes_off( $html, $result ) { |
||
| 861 | |||
| 862 | /** |
||
| 863 | * Provide data for testing smart quotes. |
||
| 864 | * |
||
| 865 | * @return array |
||
| 866 | */ |
||
| 867 | public function provide_smart_quotes_special_data() { |
||
| 872 | |||
| 873 | /** |
||
| 874 | * Test smart_quotes. |
||
| 875 | * |
||
| 876 | * @coversNothing |
||
| 877 | * |
||
| 878 | * @uses PHP_Typography\Text_Parser |
||
| 879 | * @uses PHP_Typography\Text_Parser\Token |
||
| 880 | * |
||
| 881 | * @dataProvider provide_smart_quotes_special_data |
||
| 882 | * |
||
| 883 | * @param string $html HTML input. |
||
| 884 | * @param string $result Expected entity-escaped result. |
||
| 885 | * @param string $primary Primary quote style. |
||
| 886 | * @param string $secondary Secondard quote style. |
||
| 887 | */ |
||
| 888 | public function test_smart_quotes_special( $html, $result, $primary, $secondary ) { |
||
| 895 | |||
| 896 | |||
| 897 | /** |
||
| 898 | * Test smart_dashes. |
||
| 899 | * |
||
| 900 | * @coversNothing |
||
| 901 | * |
||
| 902 | * @uses PHP_Typography\Text_Parser |
||
| 903 | * @uses PHP_Typography\Text_Parser\Token |
||
| 904 | * |
||
| 905 | * @dataProvider provide_smart_dashes_data |
||
| 906 | * |
||
| 907 | * @param string $input HTML input. |
||
| 908 | * @param string $result_us Entity-escaped result with US dash style. |
||
| 909 | * @param string $result_int Entity-escaped result with international dash style. |
||
| 910 | */ |
||
| 911 | View Code Duplication | public function test_smart_dashes_with_dash_spacing_off( $input, $result_us, $result_int ) { |
|
| 921 | |||
| 922 | |||
| 923 | /** |
||
| 924 | * Test smart_dashes. |
||
| 925 | * |
||
| 926 | * @coversNothing |
||
| 927 | * |
||
| 928 | * @uses PHP_Typography\Text_Parser |
||
| 929 | * @uses PHP_Typography\Text_Parser\Token |
||
| 930 | * |
||
| 931 | * @dataProvider provide_smart_dashes_data |
||
| 932 | * |
||
| 933 | * @param string $input HTML input. |
||
| 934 | * @param string $result_us Entity-escaped result with US dash style. |
||
| 935 | * @param string $result_int Entity-escaped result with international dash style. |
||
| 936 | */ |
||
| 937 | View Code Duplication | public function test_smart_dashes_off( $input, $result_us, $result_int ) { |
|
| 947 | |||
| 948 | /** |
||
| 949 | * Provide data for testing smart_ellipses. |
||
| 950 | * |
||
| 951 | * @return array |
||
| 952 | */ |
||
| 953 | public function provide_smart_ellipses_data() { |
||
| 958 | |||
| 959 | /** |
||
| 960 | * Test smart_ellipses. |
||
| 961 | * |
||
| 962 | * @coversNothing |
||
| 963 | * |
||
| 964 | * @uses PHP_Typography\Text_Parser |
||
| 965 | * @uses PHP_Typography\Text_Parser\Token |
||
| 966 | * |
||
| 967 | * @dataProvider provide_smart_ellipses_data |
||
| 968 | * |
||
| 969 | * @param string $input HTML intput. |
||
| 970 | * @param string $result Expected result. |
||
| 971 | */ |
||
| 972 | public function test_smart_ellipses( $input, $result ) { |
||
| 977 | |||
| 978 | /** |
||
| 979 | * Test smart_ellipses. |
||
| 980 | * |
||
| 981 | * @coversNothing |
||
| 982 | * |
||
| 983 | * @uses PHP_Typography\Text_Parser |
||
| 984 | * @uses PHP_Typography\Text_Parser\Token |
||
| 985 | * |
||
| 986 | * @dataProvider provide_smart_ellipses_data |
||
| 987 | * |
||
| 988 | * @param string $input HTML intput. |
||
| 989 | * @param string $result Ignored. |
||
| 990 | */ |
||
| 991 | public function test_smart_ellipses_off( $input, $result ) { |
||
| 996 | |||
| 997 | /** |
||
| 998 | * Provide data for testing smart_diacritics. |
||
| 999 | * |
||
| 1000 | * @return array |
||
| 1001 | */ |
||
| 1002 | View Code Duplication | public function provide_smart_diacritics_data() { |
|
| 1010 | |||
| 1011 | /** |
||
| 1012 | * Test smart_diacritics. |
||
| 1013 | * |
||
| 1014 | * @coversNothing |
||
| 1015 | * |
||
| 1016 | * @uses PHP_Typography\Text_Parser |
||
| 1017 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1018 | * |
||
| 1019 | * @dataProvider provide_smart_diacritics_data |
||
| 1020 | * |
||
| 1021 | * @param string $html HTML input. |
||
| 1022 | * @param string $result Expected result. |
||
| 1023 | * @param string $lang Language code. |
||
| 1024 | */ |
||
| 1025 | public function test_smart_diacritics( $html, $result, $lang ) { |
||
| 1031 | |||
| 1032 | /** |
||
| 1033 | * Test smart_diacritics. |
||
| 1034 | * |
||
| 1035 | * @coversNothing |
||
| 1036 | * |
||
| 1037 | * @uses PHP_Typography\Text_Parser |
||
| 1038 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1039 | * |
||
| 1040 | * @dataProvider provide_smart_diacritics_data |
||
| 1041 | * |
||
| 1042 | * @param string $html HTML input. |
||
| 1043 | * @param string $result Ignored. |
||
| 1044 | * @param string $lang Language code. |
||
| 1045 | */ |
||
| 1046 | public function test_smart_diacritics_off( $html, $result, $lang ) { |
||
| 1052 | |||
| 1053 | /** |
||
| 1054 | * Provide data for testing smart_diacritics. |
||
| 1055 | * |
||
| 1056 | * @return array |
||
| 1057 | */ |
||
| 1058 | public function provide_smart_diacritics_error_in_pattern_data() { |
||
| 1063 | |||
| 1064 | /** |
||
| 1065 | * Test smart_diacritics. |
||
| 1066 | * |
||
| 1067 | * @coversNothing |
||
| 1068 | * |
||
| 1069 | * @uses PHP_Typography\Text_Parser |
||
| 1070 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1071 | * |
||
| 1072 | * @dataProvider provide_smart_diacritics_error_in_pattern_data |
||
| 1073 | * |
||
| 1074 | * @param string $html HTML input. |
||
| 1075 | * @param string $lang Language code. |
||
| 1076 | * @param string $unset Replacement to unset. |
||
| 1077 | */ |
||
| 1078 | public function test_smart_diacritics_error_in_pattern( $html, $lang, $unset ) { |
||
| 1090 | |||
| 1091 | /** |
||
| 1092 | * Provide data for testing smart_marks. |
||
| 1093 | * |
||
| 1094 | * @return array |
||
| 1095 | */ |
||
| 1096 | public function provide_smart_marks_data() { |
||
| 1113 | |||
| 1114 | /** |
||
| 1115 | * Test smart_marks. |
||
| 1116 | * |
||
| 1117 | * @coversNothing |
||
| 1118 | * |
||
| 1119 | * @uses PHP_Typography\Text_Parser |
||
| 1120 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1121 | * |
||
| 1122 | * @dataProvider provide_smart_marks_data |
||
| 1123 | * |
||
| 1124 | * @param string $input HTML input. |
||
| 1125 | * @param string $result Expected result. |
||
| 1126 | */ |
||
| 1127 | public function test_smart_marks( $input, $result ) { |
||
| 1132 | |||
| 1133 | /** |
||
| 1134 | * Test smart_marks. |
||
| 1135 | * |
||
| 1136 | * @coversNothing |
||
| 1137 | * |
||
| 1138 | * @uses PHP_Typography\Text_Parser |
||
| 1139 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1140 | * |
||
| 1141 | * @dataProvider provide_smart_marks_data |
||
| 1142 | * |
||
| 1143 | * @param string $input HTML input. |
||
| 1144 | * @param string $result Ignored. |
||
| 1145 | */ |
||
| 1146 | public function test_smart_marks_off( $input, $result ) { |
||
| 1151 | |||
| 1152 | /** |
||
| 1153 | * Data provider for smarth_math test. |
||
| 1154 | */ |
||
| 1155 | public function provide_smart_math_data() { |
||
| 1175 | |||
| 1176 | /** |
||
| 1177 | * Test smart_math. |
||
| 1178 | * |
||
| 1179 | * @coversNothing |
||
| 1180 | * |
||
| 1181 | * @uses PHP_Typography\Text_Parser |
||
| 1182 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1183 | * |
||
| 1184 | * @dataProvider provide_smart_math_data |
||
| 1185 | * |
||
| 1186 | * @param string $result Expected result. |
||
| 1187 | * @param string $input HTML input. |
||
| 1188 | * @param bool $same Result expected to be the same or not the same. |
||
| 1189 | */ |
||
| 1190 | View Code Duplication | public function test_smart_math( $result, $input, $same ) { |
|
| 1199 | |||
| 1200 | /** |
||
| 1201 | * Test smart_math. |
||
| 1202 | * |
||
| 1203 | * @coversNothing |
||
| 1204 | * |
||
| 1205 | * @uses PHP_Typography\Text_Parser |
||
| 1206 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1207 | * |
||
| 1208 | * @dataProvider provide_smart_math_data |
||
| 1209 | * |
||
| 1210 | * @param string $result Ignored. |
||
| 1211 | * @param string $input HTML input. |
||
| 1212 | * @param bool $same Ignored. |
||
| 1213 | */ |
||
| 1214 | public function test_smart_math_off( $result, $input, $same ) { |
||
| 1219 | |||
| 1220 | /** |
||
| 1221 | * Test smart_exponents. |
||
| 1222 | * |
||
| 1223 | * @coversNothing |
||
| 1224 | * |
||
| 1225 | * @uses PHP_Typography\Text_Parser |
||
| 1226 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1227 | */ |
||
| 1228 | public function test_smart_exponents() { |
||
| 1233 | |||
| 1234 | /** |
||
| 1235 | * Test smart_exponents. |
||
| 1236 | * |
||
| 1237 | * @coversNothing |
||
| 1238 | * |
||
| 1239 | * @uses PHP_Typography\Text_Parser |
||
| 1240 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1241 | */ |
||
| 1242 | public function test_smart_exponents_off() { |
||
| 1247 | |||
| 1248 | /** |
||
| 1249 | * Provide data for testing smart_fractions. |
||
| 1250 | * |
||
| 1251 | * @return array |
||
| 1252 | */ |
||
| 1253 | public function provide_smart_fractions_data() { |
||
| 1285 | |||
| 1286 | /** |
||
| 1287 | * Test smart_fractions. |
||
| 1288 | * |
||
| 1289 | * @coversNothing |
||
| 1290 | * |
||
| 1291 | * @uses PHP_Typography\Text_Parser |
||
| 1292 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1293 | * |
||
| 1294 | * @dataProvider provide_smart_fractions_data |
||
| 1295 | * |
||
| 1296 | * @param string $input HTML input. |
||
| 1297 | * @param string $result Expected result. |
||
| 1298 | * @param string $result_spacing Expected result with spacing enabled. |
||
| 1299 | * @param string $num_css_class CSS class for numerator. |
||
| 1300 | * @param string $denom_css_class CSS class for denominator. |
||
| 1301 | */ |
||
| 1302 | public function test_smart_fractions( $input, $result, $result_spacing, $num_css_class, $denom_css_class ) { |
||
| 1316 | |||
| 1317 | |||
| 1318 | /** |
||
| 1319 | * Test smart_fractions. |
||
| 1320 | * |
||
| 1321 | * @coversNothing |
||
| 1322 | * |
||
| 1323 | * @uses PHP_Typography\Text_Parser |
||
| 1324 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1325 | * |
||
| 1326 | * @dataProvider provide_smart_fractions_data |
||
| 1327 | * |
||
| 1328 | * @param string $input HTML input. |
||
| 1329 | * @param string $result Expected result. |
||
| 1330 | * @param string $result_spacing Expected result with spacing enabled. |
||
| 1331 | * @param string $num_css_class CSS class for numerator. |
||
| 1332 | * @param string $denom_css_class CSS class for denominator. |
||
| 1333 | */ |
||
| 1334 | public function test_smart_fractions_off( $input, $result, $result_spacing, $num_css_class, $denom_css_class ) { |
||
| 1344 | |||
| 1345 | /** |
||
| 1346 | * Provide data for testing smart_fractions and smart_quotes together. |
||
| 1347 | * |
||
| 1348 | * @return array |
||
| 1349 | */ |
||
| 1350 | public function provide_smart_fractions_smart_quotes_data() { |
||
| 1360 | |||
| 1361 | /** |
||
| 1362 | * Test smart_fractions. |
||
| 1363 | * |
||
| 1364 | * @coversNothing |
||
| 1365 | * |
||
| 1366 | * @uses PHP_Typography\Text_Parser |
||
| 1367 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1368 | * |
||
| 1369 | * @dataProvider provide_smart_fractions_smart_quotes_data |
||
| 1370 | * |
||
| 1371 | * @param string $input HTML input. |
||
| 1372 | * @param string $result Expected result. |
||
| 1373 | * @param string $num_css_class CSS class for numerator. |
||
| 1374 | * @param string $denom_css_class CSS class for denominator. |
||
| 1375 | */ |
||
| 1376 | public function test_smart_fractions_with_smart_quotes( $input, $result, $num_css_class, $denom_css_class ) { |
||
| 1388 | |||
| 1389 | /** |
||
| 1390 | * Provide data for testing fraction spacing. |
||
| 1391 | * |
||
| 1392 | * @return array |
||
| 1393 | */ |
||
| 1394 | public function provide_fraction_spacing_data() { |
||
| 1406 | |||
| 1407 | |||
| 1408 | /** |
||
| 1409 | * Test smart_fractions. |
||
| 1410 | * |
||
| 1411 | * @coversNothing |
||
| 1412 | * |
||
| 1413 | * @uses PHP_Typography\Text_Parser |
||
| 1414 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1415 | * |
||
| 1416 | * @dataProvider provide_fraction_spacing_data |
||
| 1417 | * |
||
| 1418 | * @param string $input HTML input. |
||
| 1419 | * @param string $result Expected result. |
||
| 1420 | */ |
||
| 1421 | public function test_smart_fractions_only_spacing( $input, $result ) { |
||
| 1427 | |||
| 1428 | /** |
||
| 1429 | * Provide data for testing ordinal suffixes. |
||
| 1430 | * |
||
| 1431 | * @return array |
||
| 1432 | */ |
||
| 1433 | View Code Duplication | public function provide_smart_ordinal_suffix() { |
|
| 1445 | |||
| 1446 | /** |
||
| 1447 | * Test smart_ordinal_suffix. |
||
| 1448 | * |
||
| 1449 | * @coversNothing |
||
| 1450 | * |
||
| 1451 | * @uses PHP_Typography\Text_Parser |
||
| 1452 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1453 | * |
||
| 1454 | * @dataProvider provide_smart_ordinal_suffix |
||
| 1455 | * |
||
| 1456 | * @param string $input HTML input. |
||
| 1457 | * @param string $result Expected result. |
||
| 1458 | * @param string $css_class CSS class for ordinal suffix. |
||
| 1459 | */ |
||
| 1460 | View Code Duplication | public function test_smart_ordinal_suffix( $input, $result, $css_class ) { |
|
| 1468 | |||
| 1469 | |||
| 1470 | /** |
||
| 1471 | * Test smart_ordinal_suffix. |
||
| 1472 | * |
||
| 1473 | * @coversNothing |
||
| 1474 | * |
||
| 1475 | * @uses PHP_Typography\Text_Parser |
||
| 1476 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1477 | * |
||
| 1478 | * @dataProvider provide_smart_ordinal_suffix |
||
| 1479 | * |
||
| 1480 | * @param string $input HTML input. |
||
| 1481 | * @param string $result Expected result. |
||
| 1482 | * @param string $css_class CSS class for ordinal suffix. |
||
| 1483 | */ |
||
| 1484 | View Code Duplication | public function test_smart_ordinal_suffix_off( $input, $result, $css_class ) { |
|
| 1492 | |||
| 1493 | /** |
||
| 1494 | * Provide data for testing single character word spacing. |
||
| 1495 | * |
||
| 1496 | * @return array |
||
| 1497 | */ |
||
| 1498 | public function provide_single_character_word_spacing_data() { |
||
| 1506 | |||
| 1507 | /** |
||
| 1508 | * Test single_character_word_spacing. |
||
| 1509 | * |
||
| 1510 | * @coversNothing |
||
| 1511 | * |
||
| 1512 | * @uses PHP_Typography\Text_Parser |
||
| 1513 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1514 | * |
||
| 1515 | * @dataProvider provide_single_character_word_spacing_data |
||
| 1516 | * |
||
| 1517 | * @param string $input HTML input. |
||
| 1518 | * @param string $result Expected result. |
||
| 1519 | */ |
||
| 1520 | public function test_single_character_word_spacing( $input, $result ) { |
||
| 1525 | |||
| 1526 | |||
| 1527 | /** |
||
| 1528 | * Test single_character_word_spacing. |
||
| 1529 | * |
||
| 1530 | * @coversNothing |
||
| 1531 | * |
||
| 1532 | * @uses PHP_Typography\Text_Parser |
||
| 1533 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1534 | * |
||
| 1535 | * @dataProvider provide_single_character_word_spacing_data |
||
| 1536 | * |
||
| 1537 | * @param string $input HTML input. |
||
| 1538 | * @param string $result Expected result. |
||
| 1539 | */ |
||
| 1540 | public function test_single_character_word_spacing_off( $input, $result ) { |
||
| 1545 | |||
| 1546 | /** |
||
| 1547 | * Provide data for testing dash spacing. |
||
| 1548 | * |
||
| 1549 | * @return array |
||
| 1550 | */ |
||
| 1551 | public function provide_dash_spacing_data() { |
||
| 1570 | |||
| 1571 | /** |
||
| 1572 | * Provide data for testing smart dashes. |
||
| 1573 | * |
||
| 1574 | * @return array |
||
| 1575 | */ |
||
| 1576 | public function provide_smart_dashes_data() { |
||
| 1605 | |||
| 1606 | /** |
||
| 1607 | * Provide data for testing smart dashes (where hyphen should not be changed). |
||
| 1608 | * |
||
| 1609 | * @return array |
||
| 1610 | */ |
||
| 1611 | View Code Duplication | public function provide_dash_spacing_unchanged_data() { |
|
| 1619 | |||
| 1620 | |||
| 1621 | /** |
||
| 1622 | * Test dash_spacing. |
||
| 1623 | * |
||
| 1624 | * @coversNothing |
||
| 1625 | * |
||
| 1626 | * @uses PHP_Typography\Text_Parser |
||
| 1627 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1628 | * |
||
| 1629 | * @dataProvider provide_dash_spacing_data |
||
| 1630 | * |
||
| 1631 | * @param string $input HTML input. |
||
| 1632 | * @param string $result_us Entity-escaped result with US dash style. |
||
| 1633 | * @param string $result_int Entity-escaped result with international dash style. |
||
| 1634 | */ |
||
| 1635 | View Code Duplication | public function test_dash_spacing( $input, $result_us, $result_int ) { |
|
| 1645 | |||
| 1646 | |||
| 1647 | /** |
||
| 1648 | * Test dash_spacing. |
||
| 1649 | * |
||
| 1650 | * @coversNothing |
||
| 1651 | * |
||
| 1652 | * @uses PHP_Typography\Text_Parser |
||
| 1653 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1654 | * |
||
| 1655 | * @dataProvider provide_dash_spacing_unchanged_data |
||
| 1656 | * |
||
| 1657 | * @param string $input HTML input. |
||
| 1658 | */ |
||
| 1659 | View Code Duplication | public function test_dash_spacing_unchanged( $input ) { |
|
| 1669 | |||
| 1670 | /** |
||
| 1671 | * Provide data for special white space collapsing. |
||
| 1672 | * |
||
| 1673 | * @return array |
||
| 1674 | */ |
||
| 1675 | View Code Duplication | public function provide_space_collapse_data() { |
|
| 1682 | |||
| 1683 | |||
| 1684 | /** |
||
| 1685 | * Test space_collapse. |
||
| 1686 | * |
||
| 1687 | * @coversNothing |
||
| 1688 | * |
||
| 1689 | * @uses PHP_Typography\Text_Parser |
||
| 1690 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1691 | * |
||
| 1692 | * @dataProvider provide_space_collapse_data |
||
| 1693 | * |
||
| 1694 | * @param string $input HTML input. |
||
| 1695 | * @param string $result Expected result. |
||
| 1696 | */ |
||
| 1697 | public function test_space_collapse( $input, $result ) { |
||
| 1702 | |||
| 1703 | |||
| 1704 | /** |
||
| 1705 | * Test space_collapse. |
||
| 1706 | * |
||
| 1707 | * @coversNothing |
||
| 1708 | * |
||
| 1709 | * @uses PHP_Typography\Text_Parser |
||
| 1710 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1711 | * |
||
| 1712 | * @dataProvider provide_space_collapse_data |
||
| 1713 | * |
||
| 1714 | * @param string $input HTML input. |
||
| 1715 | * @param string $result Expected result. |
||
| 1716 | */ |
||
| 1717 | public function test_space_collapse_off( $input, $result ) { |
||
| 1722 | |||
| 1723 | /** |
||
| 1724 | * Provide data for testing unit_spacing. |
||
| 1725 | * |
||
| 1726 | * @return array |
||
| 1727 | */ |
||
| 1728 | public function provide_unit_spacing_data() { |
||
| 1736 | |||
| 1737 | /** |
||
| 1738 | * Test unit_spacing. |
||
| 1739 | * |
||
| 1740 | * @coversNothing |
||
| 1741 | * |
||
| 1742 | * @uses PHP_Typography\Text_Parser |
||
| 1743 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1744 | * |
||
| 1745 | * @dataProvider provide_unit_spacing_data |
||
| 1746 | * |
||
| 1747 | * @param string $input HTML input. |
||
| 1748 | * @param string $result Expected result. |
||
| 1749 | */ |
||
| 1750 | public function test_unit_spacing( $input, $result ) { |
||
| 1756 | |||
| 1757 | /** |
||
| 1758 | * Test unit_spacing. |
||
| 1759 | * |
||
| 1760 | * @coversNothing |
||
| 1761 | * |
||
| 1762 | * @uses PHP_Typography\Text_Parser |
||
| 1763 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1764 | * |
||
| 1765 | * @dataProvider provide_unit_spacing_data |
||
| 1766 | * |
||
| 1767 | * @param string $input HTML input. |
||
| 1768 | * @param string $result Expected result. |
||
| 1769 | */ |
||
| 1770 | public function test_unit_spacing_off( $input, $result ) { |
||
| 1775 | |||
| 1776 | /** |
||
| 1777 | * Provide data for testing unit_spacing. |
||
| 1778 | * |
||
| 1779 | * @return array |
||
| 1780 | */ |
||
| 1781 | public function provide_numbered_abbreviation_spacing_data() { |
||
| 1798 | |||
| 1799 | /** |
||
| 1800 | * Test numbered_abbreviation_spacing. |
||
| 1801 | * |
||
| 1802 | * @coversNothing |
||
| 1803 | * |
||
| 1804 | * @uses PHP_Typography\Text_Parser |
||
| 1805 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1806 | * |
||
| 1807 | * @dataProvider provide_numbered_abbreviation_spacing_data |
||
| 1808 | * |
||
| 1809 | * @param string $input HTML input. |
||
| 1810 | * @param string $result Expected result. |
||
| 1811 | */ |
||
| 1812 | public function test_numbered_abbreviation_spacing( $input, $result ) { |
||
| 1817 | |||
| 1818 | /** |
||
| 1819 | * Test numbered_abbreviation_spacing. |
||
| 1820 | * |
||
| 1821 | * @coversNothing |
||
| 1822 | * |
||
| 1823 | * @uses PHP_Typography\Text_Parser |
||
| 1824 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1825 | * |
||
| 1826 | * @dataProvider provide_numbered_abbreviation_spacing_data |
||
| 1827 | * |
||
| 1828 | * @param string $input HTML input. |
||
| 1829 | * @param string $result Expected result. |
||
| 1830 | */ |
||
| 1831 | public function test_numbered_abbreviation_spacing_off( $input, $result ) { |
||
| 1836 | |||
| 1837 | /** |
||
| 1838 | * Provide data for testing French punctuation rules. |
||
| 1839 | * |
||
| 1840 | * @return array |
||
| 1841 | */ |
||
| 1842 | public function provide_french_punctuation_spacing_data() { |
||
| 1863 | |||
| 1864 | |||
| 1865 | /** |
||
| 1866 | * Test french_punctuation_spacing. |
||
| 1867 | * |
||
| 1868 | * @coversNothing |
||
| 1869 | * |
||
| 1870 | * @uses PHP_Typography\Text_Parser |
||
| 1871 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1872 | * @uses ::set_smart_quotes |
||
| 1873 | * @uses ::set_smart_quotes_primary |
||
| 1874 | * |
||
| 1875 | * @dataProvider provide_french_punctuation_spacing_data |
||
| 1876 | * |
||
| 1877 | * @param string $input HTML input. |
||
| 1878 | * @param string $result Expected result. |
||
| 1879 | * @param bool $use_french_quotes Enable French primary quotes style. |
||
| 1880 | */ |
||
| 1881 | public function test_french_punctuation_spacing( $input, $result, $use_french_quotes ) { |
||
| 1892 | |||
| 1893 | |||
| 1894 | /** |
||
| 1895 | * Test french_punctuation_spacing. |
||
| 1896 | * |
||
| 1897 | * @coversNothing |
||
| 1898 | * |
||
| 1899 | * @uses PHP_Typography\Text_Parser |
||
| 1900 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1901 | * |
||
| 1902 | * @dataProvider provide_french_punctuation_spacing_data |
||
| 1903 | * |
||
| 1904 | * @param string $input HTML input. |
||
| 1905 | * @param string $result Expected result. |
||
| 1906 | */ |
||
| 1907 | public function test_french_punctuation_spacing_off( $input, $result ) { |
||
| 1912 | |||
| 1913 | /** |
||
| 1914 | * Provide data for testing wrap_hard_hyphens. |
||
| 1915 | * |
||
| 1916 | * @return array |
||
| 1917 | */ |
||
| 1918 | public function provide_wrap_hard_hyphens_data() { |
||
| 1925 | |||
| 1926 | |||
| 1927 | /** |
||
| 1928 | * Test wrap_hard_hyphens. |
||
| 1929 | * |
||
| 1930 | * @coversNothing |
||
| 1931 | * |
||
| 1932 | * @uses PHP_Typography\Text_Parser |
||
| 1933 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1934 | * |
||
| 1935 | * @dataProvider provide_wrap_hard_hyphens_data |
||
| 1936 | * |
||
| 1937 | * @param string $input HTML input. |
||
| 1938 | * @param string $result Expected result. |
||
| 1939 | */ |
||
| 1940 | View Code Duplication | public function test_wrap_hard_hyphens( $input, $result ) { |
|
| 1947 | |||
| 1948 | |||
| 1949 | /** |
||
| 1950 | * Test wrap_hard_hyphens. |
||
| 1951 | * |
||
| 1952 | * @coversNothing |
||
| 1953 | * |
||
| 1954 | * @uses PHP_Typography\Text_Parser |
||
| 1955 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1956 | * |
||
| 1957 | * @dataProvider provide_wrap_hard_hyphens_data |
||
| 1958 | * |
||
| 1959 | * @param string $input HTML input. |
||
| 1960 | * @param string $result Expected result. |
||
| 1961 | */ |
||
| 1962 | View Code Duplication | public function test_wrap_hard_hyphens_with_smart_dashes( $input, $result ) { |
|
| 1969 | |||
| 1970 | |||
| 1971 | /** |
||
| 1972 | * Test wrap_hard_hyphens. |
||
| 1973 | * |
||
| 1974 | * @coversNothing |
||
| 1975 | * |
||
| 1976 | * @uses PHP_Typography\Text_Parser |
||
| 1977 | * @uses PHP_Typography\Text_Parser\Token |
||
| 1978 | * |
||
| 1979 | * @dataProvider provide_wrap_hard_hyphens_data |
||
| 1980 | * |
||
| 1981 | * @param string $input HTML input. |
||
| 1982 | * @param string $result Expected result. |
||
| 1983 | */ |
||
| 1984 | public function test_wrap_hard_hyphens_off( $input, $result ) { |
||
| 1990 | |||
| 1991 | /** |
||
| 1992 | * Provide data for testing dewidowing. |
||
| 1993 | * |
||
| 1994 | * @return array |
||
| 1995 | */ |
||
| 1996 | public function provide_dewidow_data() { |
||
| 2012 | |||
| 2013 | /** |
||
| 2014 | * Provide data for testing dewidowing. |
||
| 2015 | * |
||
| 2016 | * @return array |
||
| 2017 | */ |
||
| 2018 | public function provide_dewidow_with_hyphenation_data() { |
||
| 2024 | |||
| 2025 | /** |
||
| 2026 | * Test dewidow. |
||
| 2027 | * |
||
| 2028 | * @coversNothing |
||
| 2029 | * |
||
| 2030 | * @uses PHP_Typography\Text_Parser |
||
| 2031 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2032 | * |
||
| 2033 | * @dataProvider provide_dewidow_data |
||
| 2034 | * |
||
| 2035 | * @param string $html HTML input. |
||
| 2036 | * @param string $result Expected result. |
||
| 2037 | * @param int $max_pull Maximum number of pulled characters. |
||
| 2038 | * @param int $max_length Maximum word length for dewidowing. |
||
| 2039 | */ |
||
| 2040 | View Code Duplication | public function test_dewidow( $html, $result, $max_pull, $max_length ) { |
|
| 2047 | |||
| 2048 | |||
| 2049 | /** |
||
| 2050 | * Test dewidow. |
||
| 2051 | * |
||
| 2052 | * @coversNothing |
||
| 2053 | * |
||
| 2054 | * @uses PHP_Typography\Text_Parser |
||
| 2055 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2056 | * @uses PHP_Typography\Hyphenator |
||
| 2057 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 2058 | * |
||
| 2059 | * @dataProvider provide_dewidow_with_hyphenation_data |
||
| 2060 | * |
||
| 2061 | * @param string $html HTML input. |
||
| 2062 | * @param string $result Expected result. |
||
| 2063 | * @param int $max_pull Maximum number of pulled characters. |
||
| 2064 | * @param int $max_length Maximum word length for dewidowing. |
||
| 2065 | */ |
||
| 2066 | View Code Duplication | public function test_dewidow_with_hyphenation( $html, $result, $max_pull, $max_length ) { |
|
| 2078 | |||
| 2079 | /** |
||
| 2080 | * Test dewidow. |
||
| 2081 | * |
||
| 2082 | * @coversNothing |
||
| 2083 | * |
||
| 2084 | * @uses PHP_Typography\Text_Parser |
||
| 2085 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2086 | * |
||
| 2087 | * @dataProvider provide_dewidow_data |
||
| 2088 | * |
||
| 2089 | * @param string $html HTML input. |
||
| 2090 | * @param string $result Expected result. |
||
| 2091 | * @param int $max_pull Maximum number of pulled characters. |
||
| 2092 | * @param int $max_length Maximum word length for dewidowing. |
||
| 2093 | */ |
||
| 2094 | View Code Duplication | public function test_dewidow_off( $html, $result, $max_pull, $max_length ) { |
|
| 2101 | |||
| 2102 | /** |
||
| 2103 | * Provide data for testing wrap_urls. |
||
| 2104 | * |
||
| 2105 | * @return array |
||
| 2106 | */ |
||
| 2107 | View Code Duplication | public function provide_wrap_urls_data() { |
|
| 2116 | |||
| 2117 | /** |
||
| 2118 | * Test wrap_urls. |
||
| 2119 | * |
||
| 2120 | * @coversNothing |
||
| 2121 | * |
||
| 2122 | * @uses PHP_Typography\Text_Parser |
||
| 2123 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2124 | * |
||
| 2125 | * @dataProvider provide_wrap_urls_data |
||
| 2126 | * |
||
| 2127 | * @param string $input HTML input. |
||
| 2128 | * @param string $result Expected result. |
||
| 2129 | * @param int $min_after Minimum number of characters after URL wrapping. |
||
| 2130 | */ |
||
| 2131 | public function test_wrap_urls( $input, $result, $min_after ) { |
||
| 2137 | |||
| 2138 | |||
| 2139 | /** |
||
| 2140 | * Test wrap_urls. |
||
| 2141 | * |
||
| 2142 | * @coversNothing |
||
| 2143 | * |
||
| 2144 | * @uses PHP_Typography\Text_Parser |
||
| 2145 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2146 | * |
||
| 2147 | * @dataProvider provide_wrap_urls_data |
||
| 2148 | * |
||
| 2149 | * @param string $html HTML input. |
||
| 2150 | * @param string $result Expected result. |
||
| 2151 | * @param int $min_after Minimum number of characters after URL wrapping. |
||
| 2152 | */ |
||
| 2153 | public function test_wrap_urls_off( $html, $result, $min_after ) { |
||
| 2159 | |||
| 2160 | /** |
||
| 2161 | * Provide data for testing wrap_emails. |
||
| 2162 | * |
||
| 2163 | * @return array |
||
| 2164 | */ |
||
| 2165 | View Code Duplication | public function provide_wrap_emails_data() { |
|
| 2172 | |||
| 2173 | /** |
||
| 2174 | * Test wrap_emails. |
||
| 2175 | * |
||
| 2176 | * @coversNothing |
||
| 2177 | * |
||
| 2178 | * @uses PHP_Typography\Text_Parser |
||
| 2179 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2180 | * |
||
| 2181 | * @dataProvider provide_wrap_emails_data |
||
| 2182 | * |
||
| 2183 | * @param string $html HTML input. |
||
| 2184 | * @param string $result Expected result. |
||
| 2185 | */ |
||
| 2186 | public function test_wrap_emails( $html, $result ) { |
||
| 2191 | |||
| 2192 | |||
| 2193 | /** |
||
| 2194 | * Test wrap_emails. |
||
| 2195 | * |
||
| 2196 | * @coversNothing |
||
| 2197 | * |
||
| 2198 | * @uses PHP_Typography\Text_Parser |
||
| 2199 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2200 | * |
||
| 2201 | * @dataProvider provide_wrap_emails_data |
||
| 2202 | * |
||
| 2203 | * @param string $html HTML input. |
||
| 2204 | * @param string $result Expected result. |
||
| 2205 | */ |
||
| 2206 | public function test_wrap_emails_off( $html, $result ) { |
||
| 2211 | |||
| 2212 | /** |
||
| 2213 | * Provide data for testing caps styling. |
||
| 2214 | * |
||
| 2215 | * @return array |
||
| 2216 | */ |
||
| 2217 | public function provide_style_caps_data() { |
||
| 2225 | |||
| 2226 | /** |
||
| 2227 | * Test style_caps. |
||
| 2228 | * |
||
| 2229 | * @coversNothing |
||
| 2230 | * |
||
| 2231 | * @uses PHP_Typography\Text_Parser |
||
| 2232 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2233 | * |
||
| 2234 | * @dataProvider provide_style_caps_data |
||
| 2235 | * |
||
| 2236 | * @param string $html HTML input. |
||
| 2237 | * @param string $result Expected result. |
||
| 2238 | */ |
||
| 2239 | public function test_style_caps( $html, $result ) { |
||
| 2244 | |||
| 2245 | |||
| 2246 | /** |
||
| 2247 | * Test style_caps. |
||
| 2248 | * |
||
| 2249 | * @coversNothing |
||
| 2250 | * |
||
| 2251 | * @uses PHP_Typography\Text_Parser |
||
| 2252 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2253 | * |
||
| 2254 | * @dataProvider provide_style_caps_data |
||
| 2255 | * |
||
| 2256 | * @param string $html HTML input. |
||
| 2257 | * @param string $result Expected result. |
||
| 2258 | */ |
||
| 2259 | public function test_style_caps_off( $html, $result ) { |
||
| 2264 | |||
| 2265 | |||
| 2266 | /** |
||
| 2267 | * Test replace_node_with_html. |
||
| 2268 | * |
||
| 2269 | * @covers ::replace_node_with_html |
||
| 2270 | */ |
||
| 2271 | public function test_replace_node_with_html() { |
||
| 2286 | |||
| 2287 | |||
| 2288 | /** |
||
| 2289 | * Test replace_node_with_html. |
||
| 2290 | * |
||
| 2291 | * @covers ::replace_node_with_html |
||
| 2292 | */ |
||
| 2293 | public function test_replace_node_with_html_invalid() { |
||
| 2301 | |||
| 2302 | /** |
||
| 2303 | * Provide data for testing style_numbers. |
||
| 2304 | * |
||
| 2305 | * @return array |
||
| 2306 | */ |
||
| 2307 | public function provide_style_numbers_data() { |
||
| 2315 | |||
| 2316 | |||
| 2317 | /** |
||
| 2318 | * Test style_numbers. |
||
| 2319 | * |
||
| 2320 | * @coversNothing |
||
| 2321 | * |
||
| 2322 | * @uses PHP_Typography\Text_Parser |
||
| 2323 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2324 | * |
||
| 2325 | * @dataProvider provide_style_numbers_data |
||
| 2326 | * |
||
| 2327 | * @param string $html HTML input. |
||
| 2328 | * @param string $result Expected result. |
||
| 2329 | */ |
||
| 2330 | public function test_style_numbers( $html, $result ) { |
||
| 2335 | |||
| 2336 | |||
| 2337 | /** |
||
| 2338 | * Test style_numbers. |
||
| 2339 | * |
||
| 2340 | * @coversNothing |
||
| 2341 | * |
||
| 2342 | * @uses PHP_Typography\Text_Parser |
||
| 2343 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2344 | * |
||
| 2345 | * @dataProvider provide_style_numbers_data |
||
| 2346 | * |
||
| 2347 | * @param string $html HTML input. |
||
| 2348 | * @param string $result Expected result. |
||
| 2349 | */ |
||
| 2350 | public function test_style_numbers_off( $html, $result ) { |
||
| 2355 | |||
| 2356 | /** |
||
| 2357 | * Provide data for testing the injection of CSS hooks. |
||
| 2358 | * |
||
| 2359 | * @return array |
||
| 2360 | */ |
||
| 2361 | public function provide_style_caps_and_numbers_data() { |
||
| 2370 | |||
| 2371 | /** |
||
| 2372 | * Test styling caps and numbers at the same time. |
||
| 2373 | * |
||
| 2374 | * @coversNothing |
||
| 2375 | * |
||
| 2376 | * @uses PHP_Typography\Text_Parser |
||
| 2377 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2378 | * |
||
| 2379 | * @dataProvider provide_style_caps_and_numbers_data |
||
| 2380 | * |
||
| 2381 | * @param string $html HTML input. |
||
| 2382 | * @param string $result Expected result. |
||
| 2383 | */ |
||
| 2384 | public function test_style_caps_and_numbers( $html, $result ) { |
||
| 2390 | |||
| 2391 | /** |
||
| 2392 | * Provide data for testing stye_hanging_punctuation. |
||
| 2393 | * |
||
| 2394 | * @return array |
||
| 2395 | */ |
||
| 2396 | View Code Duplication | public function provide_style_hanging_punctuation_data() { |
|
| 2403 | |||
| 2404 | /** |
||
| 2405 | * Test style_hanging_punctuation. |
||
| 2406 | * |
||
| 2407 | * @coversNothing |
||
| 2408 | * |
||
| 2409 | * @uses PHP_Typography\Text_Parser |
||
| 2410 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2411 | * |
||
| 2412 | * @dataProvider provide_style_hanging_punctuation_data |
||
| 2413 | * |
||
| 2414 | * @param string $html HTML input. |
||
| 2415 | * @param string $result Expected result. |
||
| 2416 | */ |
||
| 2417 | public function test_style_hanging_punctuation( $html, $result ) { |
||
| 2422 | |||
| 2423 | |||
| 2424 | /** |
||
| 2425 | * Test style_hanging_punctuation. |
||
| 2426 | * |
||
| 2427 | * @coversNothing |
||
| 2428 | * |
||
| 2429 | * @uses PHP_Typography\Text_Parser |
||
| 2430 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2431 | * |
||
| 2432 | * @dataProvider provide_style_hanging_punctuation_data |
||
| 2433 | * |
||
| 2434 | * @param string $html HTML input. |
||
| 2435 | * @param string $result Expected result. |
||
| 2436 | */ |
||
| 2437 | public function test_style_hanging_punctuation_off( $html, $result ) { |
||
| 2442 | |||
| 2443 | |||
| 2444 | /** |
||
| 2445 | * Test style_ampersands. |
||
| 2446 | * |
||
| 2447 | * @coversNothing |
||
| 2448 | * |
||
| 2449 | * @uses PHP_Typography\Text_Parser |
||
| 2450 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2451 | */ |
||
| 2452 | public function test_style_ampersands() { |
||
| 2457 | |||
| 2458 | |||
| 2459 | /** |
||
| 2460 | * Test style_ampersands. |
||
| 2461 | * |
||
| 2462 | * @coversNothing |
||
| 2463 | * |
||
| 2464 | * @uses PHP_Typography\Text_Parser |
||
| 2465 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2466 | */ |
||
| 2467 | public function test_style_ampersands_off() { |
||
| 2472 | |||
| 2473 | /** |
||
| 2474 | * Provide data for testing initial quotes' styling. |
||
| 2475 | * |
||
| 2476 | * @return array |
||
| 2477 | */ |
||
| 2478 | public function provide_style_initial_quotes_data() { |
||
| 2487 | |||
| 2488 | /** |
||
| 2489 | * Test style_initial_quotes. |
||
| 2490 | * |
||
| 2491 | * @coversNothing |
||
| 2492 | * |
||
| 2493 | * @uses PHP_Typography\Text_Parser |
||
| 2494 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2495 | * |
||
| 2496 | * @dataProvider provide_style_initial_quotes_data |
||
| 2497 | * |
||
| 2498 | * @param string $html HTML input. |
||
| 2499 | * @param string $result Expected result. |
||
| 2500 | * @param bool $is_title Treat as heading tag. |
||
| 2501 | */ |
||
| 2502 | public function test_style_initial_quotes( $html, $result, $is_title ) { |
||
| 2508 | |||
| 2509 | |||
| 2510 | /** |
||
| 2511 | * Test style_initial_quotes. |
||
| 2512 | * |
||
| 2513 | * @coversNothing |
||
| 2514 | * |
||
| 2515 | * @uses PHP_Typography\Text_Parser |
||
| 2516 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2517 | * |
||
| 2518 | * @dataProvider provide_style_initial_quotes_data |
||
| 2519 | * |
||
| 2520 | * @param string $html HTML input. |
||
| 2521 | * @param string $result Expected result. |
||
| 2522 | * @param bool $is_title Treat as heading tag. |
||
| 2523 | */ |
||
| 2524 | public function test_style_initial_quotes_off( $html, $result, $is_title ) { |
||
| 2530 | |||
| 2531 | /** |
||
| 2532 | * Provide data for testing hyphenation. |
||
| 2533 | * |
||
| 2534 | * @return array |
||
| 2535 | */ |
||
| 2536 | public function provide_hyphenate_data() { |
||
| 2548 | |||
| 2549 | |||
| 2550 | /** |
||
| 2551 | * Test hyphenate. |
||
| 2552 | * |
||
| 2553 | * @coversNothing |
||
| 2554 | * |
||
| 2555 | * @uses PHP_Typography\Text_Parser |
||
| 2556 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2557 | * @uses PHP_Typography\Hyphenator |
||
| 2558 | * |
||
| 2559 | * @dataProvider provide_hyphenate_data |
||
| 2560 | * |
||
| 2561 | * @param string $html HTML input. |
||
| 2562 | * @param string $result Expected result. |
||
| 2563 | * @param string $lang Language code. |
||
| 2564 | * @param bool $hyphenate_headings Hyphenate headings. |
||
| 2565 | * @param bool $hyphenate_all_caps Hyphenate words in ALL caps. |
||
| 2566 | * @param bool $hyphenate_title_case Hyphenate words in Title Case. |
||
| 2567 | * @param bool $hyphenate_compunds Hyphenate compound-words. |
||
| 2568 | */ |
||
| 2569 | public function test_hyphenate_off( $html, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compunds ) { |
||
| 2583 | |||
| 2584 | |||
| 2585 | /** |
||
| 2586 | * Test hyphenate. |
||
| 2587 | * |
||
| 2588 | * @coversNothing |
||
| 2589 | * |
||
| 2590 | * @uses PHP_Typography\Text_Parser |
||
| 2591 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2592 | * @uses PHP_Typography\Hyphenator |
||
| 2593 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 2594 | * |
||
| 2595 | * @dataProvider provide_hyphenate_data |
||
| 2596 | * |
||
| 2597 | * @param string $html HTML input. |
||
| 2598 | * @param string $result Expected result. |
||
| 2599 | * @param string $lang Language code. |
||
| 2600 | * @param bool $hyphenate_headings Hyphenate headings. |
||
| 2601 | * @param bool $hyphenate_all_caps Hyphenate words in ALL caps. |
||
| 2602 | * @param bool $hyphenate_title_case Hyphenate words in Title Case. |
||
| 2603 | * @param bool $hyphenate_compunds Hyphenate compound-words. |
||
| 2604 | */ |
||
| 2605 | public function test_hyphenate( $html, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compunds ) { |
||
| 2619 | |||
| 2620 | /** |
||
| 2621 | * Provide data for testing hyphenation with custom exceptions. |
||
| 2622 | * |
||
| 2623 | * @return array |
||
| 2624 | */ |
||
| 2625 | public function provide_hyphenate_with_exceptions_data() { |
||
| 2634 | |||
| 2635 | |||
| 2636 | /** |
||
| 2637 | * Test hyphenate. |
||
| 2638 | * |
||
| 2639 | * @coversNothing |
||
| 2640 | * |
||
| 2641 | * @uses PHP_Typography\Text_Parser |
||
| 2642 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2643 | * @uses PHP_Typography\Hyphenator |
||
| 2644 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 2645 | * |
||
| 2646 | * @dataProvider provide_hyphenate_with_exceptions_data |
||
| 2647 | * |
||
| 2648 | * @param string $html HTML input. |
||
| 2649 | * @param string $result Expected result. |
||
| 2650 | * @param array $exceptions Custom hyphenation exceptions. |
||
| 2651 | * @param string $lang Language code. |
||
| 2652 | * @param bool $hyphenate_headings Hyphenate headings. |
||
| 2653 | * @param bool $hyphenate_all_caps Hyphenate words in ALL caps. |
||
| 2654 | * @param bool $hyphenate_title_case Hyphenate words in Title Case. |
||
| 2655 | * @param bool $hyphenate_compunds Hyphenate compound-words. |
||
| 2656 | */ |
||
| 2657 | public function test_hyphenate_with_exceptions( $html, $result, $exceptions, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compunds ) { |
||
| 2671 | |||
| 2672 | /** |
||
| 2673 | * Test hyphenate. |
||
| 2674 | * |
||
| 2675 | * @coversNothing |
||
| 2676 | * |
||
| 2677 | * @uses PHP_Typography\Text_Parser |
||
| 2678 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2679 | * @uses PHP_Typography\Hyphenator |
||
| 2680 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 2681 | */ |
||
| 2682 | public function test_hyphenate_headings_disabled() { |
||
| 2697 | |||
| 2698 | /** |
||
| 2699 | * Test hyphenate. |
||
| 2700 | * |
||
| 2701 | * @coversNothing |
||
| 2702 | * |
||
| 2703 | * @uses PHP_Typography\Hyphenator |
||
| 2704 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 2705 | * @uses PHP_Typography\Text_Parser |
||
| 2706 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2707 | */ |
||
| 2708 | public function test_hyphenate_no_custom_exceptions() { |
||
| 2722 | |||
| 2723 | |||
| 2724 | /** |
||
| 2725 | * Test hyphenate. |
||
| 2726 | * |
||
| 2727 | * @coversNothing |
||
| 2728 | * |
||
| 2729 | * @uses PHP_Typography\Hyphenator |
||
| 2730 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 2731 | * @uses PHP_Typography\Text_Parser |
||
| 2732 | * @uses PHP_Typography\Text_Parser\Token |
||
| 2733 | */ |
||
| 2734 | public function test_hyphenate_no_exceptions_at_all() { |
||
| 2752 | |||
| 2753 | /** |
||
| 2754 | * Test init. |
||
| 2755 | * |
||
| 2756 | * @covers ::init |
||
| 2757 | * @covers ::__construct |
||
| 2758 | * |
||
| 2759 | * @uses PHP_Typography\Hyphenator |
||
| 2760 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 2761 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 2762 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 2763 | */ |
||
| 2764 | public function test_init() { |
||
| 2772 | |||
| 2773 | /** |
||
| 2774 | * Test get_html. |
||
| 2775 | * |
||
| 2776 | * @covers ::get_html5_parser |
||
| 2777 | */ |
||
| 2778 | View Code Duplication | public function test_get_html5_parser() { |
|
| 2791 | |||
| 2792 | /** |
||
| 2793 | * Test parse_html. |
||
| 2794 | * |
||
| 2795 | * @covers ::parse_html |
||
| 2796 | */ |
||
| 2797 | public function test_parse_html() { |
||
| 2803 | |||
| 2804 | |||
| 2805 | /** |
||
| 2806 | * Test parse_html. |
||
| 2807 | * |
||
| 2808 | * @covers ::parse_html |
||
| 2809 | * |
||
| 2810 | * @dataProvider provide_process_data |
||
| 2811 | * |
||
| 2812 | * @param string $html HTML input. |
||
| 2813 | * @param string $ignore1 Ignored. |
||
| 2814 | * @param string $ignore2 Ignored. |
||
| 2815 | */ |
||
| 2816 | public function test_parse_html_extended( $html, $ignore1, $ignore2 ) { |
||
| 2828 | |||
| 2829 | /** |
||
| 2830 | * Provide data for testing parsing HTML containing markup errors. |
||
| 2831 | * |
||
| 2832 | * @return array |
||
| 2833 | */ |
||
| 2834 | public function provide_parse_html_with_errors_data() { |
||
| 2840 | |||
| 2841 | /** |
||
| 2842 | * Test parse_html. |
||
| 2843 | * |
||
| 2844 | * @covers ::parse_html |
||
| 2845 | * |
||
| 2846 | * @dataProvider provide_parse_html_with_errors_data |
||
| 2847 | * |
||
| 2848 | * @param string $html HTML input. |
||
| 2849 | * @param string $error_msg Expected error message. |
||
| 2850 | */ |
||
| 2851 | public function test_parse_html_with_errors( $html, $error_msg ) { |
||
| 2871 | |||
| 2872 | /** |
||
| 2873 | * Provide data for testing arrays_intersect. |
||
| 2874 | * |
||
| 2875 | * @return array |
||
| 2876 | */ |
||
| 2877 | public function provide_arrays_intersect_data() { |
||
| 2885 | |||
| 2886 | /** |
||
| 2887 | * $a1 and $a2 need to be arrays of object indexes < 10 |
||
| 2888 | * |
||
| 2889 | * @covers ::arrays_intersect |
||
| 2890 | * @dataProvider provide_arrays_intersect_data |
||
| 2891 | * |
||
| 2892 | * @param array $a1 First array. |
||
| 2893 | * @param array $a2 Second array. |
||
| 2894 | * @param bool $result Expected result. |
||
| 2895 | */ |
||
| 2896 | public function test_arrays_intersect( array $a1, array $a2, $result ) { |
||
| 2918 | |||
| 2919 | /** |
||
| 2920 | * Tests get_hyphenator_cache. |
||
| 2921 | * |
||
| 2922 | * @covers ::get_hyphenator_cache |
||
| 2923 | */ |
||
| 2924 | public function test_get_hyphenator_cache() { |
||
| 2929 | |||
| 2930 | /** |
||
| 2931 | * Tests set_hyphenator_cache. |
||
| 2932 | * |
||
| 2933 | * @covers ::set_hyphenator_cache |
||
| 2934 | * |
||
| 2935 | * @uses ::get_hyphenator_cache |
||
| 2936 | */ |
||
| 2937 | View Code Duplication | public function test_set_hyphenator_cache() { |
|
| 2946 | } |
||
| 2947 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.