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 Settings_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 Settings_Test, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 43 | class Settings_Test extends PHP_Typography_Testcase { |
||
| 44 | /** |
||
| 45 | * Settings fixture. |
||
| 46 | * |
||
| 47 | * @var Settings |
||
| 48 | */ |
||
| 49 | protected $settings; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Sets up the fixture, for example, opens a network connection. |
||
| 53 | * This method is called before a test is executed. |
||
| 54 | */ |
||
| 55 | protected function setUp() { |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Tears down the fixture, for example, closes a network connection. |
||
| 61 | * This method is called after a test is executed. |
||
| 62 | */ |
||
| 63 | protected function tearDown() { |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Tests set_defaults. |
||
| 68 | * |
||
| 69 | * @covers ::set_defaults |
||
| 70 | * |
||
| 71 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 72 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 73 | * @uses PHP_Typography\Strings::maybe_split_parameters |
||
| 74 | * @uses PHP_Typography\Arrays::array_map_assoc |
||
| 75 | */ |
||
| 76 | public function test_set_defaults() { |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Tests initialization. |
||
| 85 | * |
||
| 86 | * @covers ::init |
||
| 87 | * @covers ::__construct |
||
| 88 | * |
||
| 89 | * @uses ::set_defaults |
||
| 90 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 91 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 92 | * @uses PHP_Typography\Strings::maybe_split_parameters |
||
| 93 | * @uses PHP_Typography\Arrays::array_map_assoc |
||
| 94 | */ |
||
| 95 | public function test_initialization() { |
||
| 108 | |||
| 109 | |||
| 110 | /** |
||
| 111 | * Tests __get. |
||
| 112 | * |
||
| 113 | * @covers ::__get |
||
| 114 | * |
||
| 115 | * @uses ::offsetGet |
||
| 116 | */ |
||
| 117 | public function test___get() { |
||
| 123 | |||
| 124 | /** |
||
| 125 | * Tests __set. |
||
| 126 | * |
||
| 127 | * @covers ::__set |
||
| 128 | * |
||
| 129 | * @uses ::__get |
||
| 130 | * @uses ::__isset |
||
| 131 | */ |
||
| 132 | View Code Duplication | public function test___set() { |
|
| 139 | |||
| 140 | /** |
||
| 141 | * Tests __isset. |
||
| 142 | * |
||
| 143 | * @covers ::__isset |
||
| 144 | */ |
||
| 145 | View Code Duplication | public function test___isset() { |
|
| 152 | |||
| 153 | /** |
||
| 154 | * Tests __unset. |
||
| 155 | * |
||
| 156 | * @covers ::__unset |
||
| 157 | */ |
||
| 158 | View Code Duplication | public function test___unset() { |
|
| 167 | |||
| 168 | /** |
||
| 169 | * Tests offsetSet. |
||
| 170 | * |
||
| 171 | * @covers ::offsetSet |
||
| 172 | * |
||
| 173 | * @uses ::offsetGet |
||
| 174 | * @uses ::offsetExists |
||
| 175 | */ |
||
| 176 | public function test_offsetSet() { |
||
| 187 | |||
| 188 | /** |
||
| 189 | * Tests offsetExists. |
||
| 190 | * |
||
| 191 | * @covers ::offsetExists |
||
| 192 | * |
||
| 193 | * @uses ::offsetSet |
||
| 194 | */ |
||
| 195 | View Code Duplication | public function test_offsetExists() { |
|
| 203 | |||
| 204 | /** |
||
| 205 | * Tests offsetUnset. |
||
| 206 | * |
||
| 207 | * @covers ::offsetUnset |
||
| 208 | * |
||
| 209 | * @uses ::offsetSet |
||
| 210 | * @uses ::offsetGet |
||
| 211 | * @uses ::offsetExists |
||
| 212 | */ |
||
| 213 | View Code Duplication | public function test_offsetUnset() { |
|
| 222 | |||
| 223 | /** |
||
| 224 | * Tests offsetGet. |
||
| 225 | * |
||
| 226 | * @covers ::offsetGet |
||
| 227 | * |
||
| 228 | * @uses ::offsetSet |
||
| 229 | */ |
||
| 230 | public function test_offsetGet() { |
||
| 237 | |||
| 238 | /** |
||
| 239 | * Tests primary_quote_style. |
||
| 240 | * |
||
| 241 | * @covers ::primary_quote_style |
||
| 242 | */ |
||
| 243 | public function test_primary_quote_style() { |
||
| 248 | |||
| 249 | /** |
||
| 250 | * Tests secondary_quote_style. |
||
| 251 | * |
||
| 252 | * @covers ::secondary_quote_style |
||
| 253 | */ |
||
| 254 | public function test_secondary_quote_style() { |
||
| 259 | |||
| 260 | /** |
||
| 261 | * Tests dash_style. |
||
| 262 | * |
||
| 263 | * @covers ::dash_style |
||
| 264 | */ |
||
| 265 | public function test_dash_style() { |
||
| 270 | |||
| 271 | /** |
||
| 272 | * Tests custom_units. |
||
| 273 | * |
||
| 274 | * @covers ::custom_units |
||
| 275 | */ |
||
| 276 | public function test_custom_units() { |
||
| 281 | |||
| 282 | |||
| 283 | /** |
||
| 284 | * Tests set_ignore_parser_errors. |
||
| 285 | * |
||
| 286 | * @covers ::set_ignore_parser_errors |
||
| 287 | */ |
||
| 288 | public function test_set_ignore_parser_errors() { |
||
| 297 | |||
| 298 | /** |
||
| 299 | * Tests set_parser_errors_handler. |
||
| 300 | * |
||
| 301 | * @covers ::set_parser_errors_handler |
||
| 302 | */ |
||
| 303 | public function test_set_parser_errors_handler() { |
||
| 321 | |||
| 322 | /** |
||
| 323 | * Tests set_tags_to_ignore. |
||
| 324 | * |
||
| 325 | * @covers ::set_tags_to_ignore |
||
| 326 | * |
||
| 327 | * @uses PHP_Typography\Strings::maybe_split_parameters |
||
| 328 | */ |
||
| 329 | public function test_set_tags_to_ignore() { |
||
| 356 | |||
| 357 | /** |
||
| 358 | * Tests set_classes_to_ignore. |
||
| 359 | * |
||
| 360 | * @covers ::set_classes_to_ignore |
||
| 361 | * |
||
| 362 | * @uses PHP_Typography\Strings::maybe_split_parameters |
||
| 363 | */ |
||
| 364 | public function test_set_classes_to_ignore() { |
||
| 371 | |||
| 372 | /** |
||
| 373 | * Tests set_ids_to_ignore. |
||
| 374 | * |
||
| 375 | * @covers ::set_ids_to_ignore |
||
| 376 | * |
||
| 377 | * @uses PHP_Typography\Strings::maybe_split_parameters |
||
| 378 | */ |
||
| 379 | public function test_set_ids_to_ignore() { |
||
| 386 | |||
| 387 | /** |
||
| 388 | * Tests set_smart_quotes. |
||
| 389 | * |
||
| 390 | * @covers ::set_smart_quotes |
||
| 391 | */ |
||
| 392 | View Code Duplication | public function test_set_smart_quotes() { |
|
| 399 | |||
| 400 | /** |
||
| 401 | * Tests set_smart_quotes_primary. |
||
| 402 | * |
||
| 403 | * @covers ::set_smart_quotes_primary |
||
| 404 | * @covers ::get_quote_style |
||
| 405 | * @covers ::get_style |
||
| 406 | * |
||
| 407 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 408 | */ |
||
| 409 | View Code Duplication | public function test_set_smart_quotes_primary() { |
|
| 436 | |||
| 437 | /** |
||
| 438 | * Tests set_smart_quotes_primary with an invalid input. |
||
| 439 | * |
||
| 440 | * @covers ::set_smart_quotes_primary |
||
| 441 | * @covers ::get_quote_style |
||
| 442 | * @covers ::get_style |
||
| 443 | * |
||
| 444 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 445 | * |
||
| 446 | * @expectedException \DomainException |
||
| 447 | * @expectedExceptionMessageRegExp /^Invalid quote style \w+\.$/ |
||
| 448 | */ |
||
| 449 | public function test_set_smart_quotes_primary_invalid() { |
||
| 454 | |||
| 455 | /** |
||
| 456 | * Tests set_smart_quotes_primary with a Quotes object. |
||
| 457 | * |
||
| 458 | * @covers ::set_smart_quotes_primary |
||
| 459 | * @covers ::get_quote_style |
||
| 460 | * @covers ::get_style |
||
| 461 | */ |
||
| 462 | View Code Duplication | public function test_set_smart_quotes_primary_to_object() { |
|
| 475 | |||
| 476 | /** |
||
| 477 | * Tests set_smart_quotes_secondary. |
||
| 478 | * |
||
| 479 | * @covers ::set_smart_quotes_secondary |
||
| 480 | * @covers ::get_quote_style |
||
| 481 | * @covers ::get_style |
||
| 482 | * |
||
| 483 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 484 | */ |
||
| 485 | View Code Duplication | public function test_set_smart_quotes_secondary() { |
|
| 511 | |||
| 512 | /** |
||
| 513 | * Tests set_smart_quotes_secondary with an invalid input. |
||
| 514 | * |
||
| 515 | * @covers ::set_smart_quotes_secondary |
||
| 516 | * @covers ::get_quote_style |
||
| 517 | * @covers ::get_style |
||
| 518 | * |
||
| 519 | * @uses PHP_Typography\Settings\Quote_Style::get_styled_quotes |
||
| 520 | * |
||
| 521 | * @expectedException \DomainException |
||
| 522 | * @expectedExceptionMessageRegExp /^Invalid quote style \w+\.$/ |
||
| 523 | */ |
||
| 524 | public function test_set_smart_quotes_secondary_invalid() { |
||
| 529 | |||
| 530 | /** |
||
| 531 | * Tests set_smart_quotes_secondary with a Quotes object. |
||
| 532 | * |
||
| 533 | * @covers ::set_smart_quotes_secondary |
||
| 534 | * @covers ::get_quote_style |
||
| 535 | * @covers ::get_style |
||
| 536 | */ |
||
| 537 | View Code Duplication | public function test_set_smart_quotes_secondary_to_object() { |
|
| 550 | |||
| 551 | /** |
||
| 552 | * Test set_smart_dashes. |
||
| 553 | * |
||
| 554 | * @covers ::set_smart_dashes |
||
| 555 | */ |
||
| 556 | View Code Duplication | public function test_set_smart_dashes() { |
|
| 563 | |||
| 564 | /** |
||
| 565 | * Test set_smart_dashes_style. |
||
| 566 | * |
||
| 567 | * @covers ::set_smart_dashes_style |
||
| 568 | * @covers ::get_style |
||
| 569 | * |
||
| 570 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 571 | */ |
||
| 572 | public function test_set_smart_dashes_style() { |
||
| 592 | |||
| 593 | /** |
||
| 594 | * Test set_smart_dashes_style with a Dashes object. |
||
| 595 | * |
||
| 596 | * @covers ::set_smart_dashes_style |
||
| 597 | * @covers ::get_style |
||
| 598 | */ |
||
| 599 | public function test_set_smart_dashes_style_with_object() { |
||
| 617 | |||
| 618 | /** |
||
| 619 | * Tests set_smart_dashes_style. |
||
| 620 | * |
||
| 621 | * @covers ::set_smart_dashes_style |
||
| 622 | * @covers ::get_style |
||
| 623 | * |
||
| 624 | * @uses PHP_Typography\Settings\Dash_Style::get_styled_dashes |
||
| 625 | * |
||
| 626 | * @expectedException \DomainException |
||
| 627 | * @expectedExceptionMessageRegExp /^Invalid dash style \w+.$/ |
||
| 628 | */ |
||
| 629 | public function test_set_smart_dashes_style_invalid() { |
||
| 634 | |||
| 635 | /** |
||
| 636 | * Tests set_smart_ellipses. |
||
| 637 | * |
||
| 638 | * @covers ::set_smart_ellipses |
||
| 639 | */ |
||
| 640 | View Code Duplication | public function test_set_smart_ellipses() { |
|
| 647 | |||
| 648 | /** |
||
| 649 | * Tests set_smart_diacritics. |
||
| 650 | * |
||
| 651 | * @covers ::set_smart_diacritics |
||
| 652 | */ |
||
| 653 | View Code Duplication | public function test_set_smart_diacritics() { |
|
| 660 | |||
| 661 | /** |
||
| 662 | * Tests set_diacritic_language. |
||
| 663 | * |
||
| 664 | * @covers ::set_diacritic_language |
||
| 665 | * @covers ::update_diacritics_replacement_arrays |
||
| 666 | * @covers ::parse_diacritics_rules |
||
| 667 | */ |
||
| 668 | public function test_set_diacritic_language() { |
||
| 684 | |||
| 685 | /** |
||
| 686 | * Provide data for testing set_diacritic_custom_replacements. |
||
| 687 | */ |
||
| 688 | public function provide_set_diacritic_custom_replacements_data() { |
||
| 725 | |||
| 726 | /** |
||
| 727 | * Tests set_diacritic_custom_replacements. |
||
| 728 | * |
||
| 729 | * @covers ::set_diacritic_custom_replacements |
||
| 730 | * @covers ::parse_diacritics_replacement_string |
||
| 731 | * @covers ::update_diacritics_replacement_arrays |
||
| 732 | * @covers ::parse_diacritics_rules |
||
| 733 | * |
||
| 734 | * @uses PHP_Typography\Arrays::array_map_assoc |
||
| 735 | * |
||
| 736 | * @dataProvider provide_set_diacritic_custom_replacements_data |
||
| 737 | * |
||
| 738 | * @param string|array $input Custom replacements string or array. |
||
| 739 | * @param array $keys Expected keys. |
||
| 740 | * @param array $values Expected values. |
||
| 741 | */ |
||
| 742 | public function test_set_diacritic_custom_replacements( $input, array $keys, array $values ) { |
||
| 758 | |||
| 759 | /** |
||
| 760 | * Test set_smart_marks. |
||
| 761 | * |
||
| 762 | * @covers ::set_smart_marks |
||
| 763 | */ |
||
| 764 | View Code Duplication | public function test_set_smart_marks() { |
|
| 771 | |||
| 772 | /** |
||
| 773 | * Tests set_smart_math. |
||
| 774 | * |
||
| 775 | * @covers ::set_smart_math |
||
| 776 | */ |
||
| 777 | View Code Duplication | public function test_set_smart_math() { |
|
| 784 | |||
| 785 | /** |
||
| 786 | * Tests set_smart_exponents. |
||
| 787 | * |
||
| 788 | * @covers ::set_smart_exponents |
||
| 789 | */ |
||
| 790 | View Code Duplication | public function test_set_smart_exponents() { |
|
| 797 | |||
| 798 | /** |
||
| 799 | * Tests set_smart_fractions. |
||
| 800 | * |
||
| 801 | * @covers ::set_smart_fractions |
||
| 802 | */ |
||
| 803 | View Code Duplication | public function test_set_smart_fractions() { |
|
| 810 | |||
| 811 | /** |
||
| 812 | * Tests set_smart_ordinal_suffix. |
||
| 813 | * |
||
| 814 | * @covers ::set_smart_ordinal_suffix |
||
| 815 | */ |
||
| 816 | View Code Duplication | public function test_set_smart_ordinal_suffix() { |
|
| 823 | |||
| 824 | /** |
||
| 825 | * Tests set_single_character_word_spacing. |
||
| 826 | * |
||
| 827 | * @covers ::set_single_character_word_spacing |
||
| 828 | */ |
||
| 829 | View Code Duplication | public function test_set_single_character_word_spacing() { |
|
| 836 | |||
| 837 | /** |
||
| 838 | * Tests set_fraction_spacing. |
||
| 839 | * |
||
| 840 | * @covers ::set_fraction_spacing |
||
| 841 | */ |
||
| 842 | View Code Duplication | public function test_set_fraction_spacing() { |
|
| 849 | |||
| 850 | /** |
||
| 851 | * Tests set_unit_spacing. |
||
| 852 | * |
||
| 853 | * @covers ::set_unit_spacing |
||
| 854 | */ |
||
| 855 | View Code Duplication | public function test_set_unit_spacing() { |
|
| 862 | |||
| 863 | /** |
||
| 864 | * Tests set_numbered_abbreviation_spacing. |
||
| 865 | * |
||
| 866 | * @covers ::set_numbered_abbreviation_spacing |
||
| 867 | */ |
||
| 868 | View Code Duplication | public function test_set_numbered_abbreviation_spacing() { |
|
| 875 | |||
| 876 | /** |
||
| 877 | * Tests set_french_punctuation_spacing. |
||
| 878 | * |
||
| 879 | * @covers ::set_french_punctuation_spacing |
||
| 880 | */ |
||
| 881 | View Code Duplication | public function test_set_french_punctuation_spacing() { |
|
| 888 | |||
| 889 | /** |
||
| 890 | * Tests set_units. |
||
| 891 | * |
||
| 892 | * @covers ::set_units |
||
| 893 | * @covers ::update_unit_pattern |
||
| 894 | * |
||
| 895 | * @uses PHP_Typography\Strings::maybe_split_parameters |
||
| 896 | */ |
||
| 897 | public function test_set_units() { |
||
| 916 | |||
| 917 | /** |
||
| 918 | * Tests set_dash_spacing. |
||
| 919 | * |
||
| 920 | * @covers ::set_dash_spacing |
||
| 921 | */ |
||
| 922 | View Code Duplication | public function test_set_dash_spacing() { |
|
| 929 | |||
| 930 | /** |
||
| 931 | * Tests set_space_collapse. |
||
| 932 | * |
||
| 933 | * @covers ::set_space_collapse |
||
| 934 | */ |
||
| 935 | View Code Duplication | public function test_set_space_collapse() { |
|
| 942 | |||
| 943 | /** |
||
| 944 | * Tests set_dewidow. |
||
| 945 | * |
||
| 946 | * @covers ::set_dewidow |
||
| 947 | */ |
||
| 948 | View Code Duplication | public function test_set_dewidow() { |
|
| 955 | |||
| 956 | /** |
||
| 957 | * Tests set_max_dewidow_length. |
||
| 958 | * |
||
| 959 | * @covers ::set_max_dewidow_length |
||
| 960 | */ |
||
| 961 | View Code Duplication | public function test_set_max_dewidow_length() { |
|
| 971 | |||
| 972 | /** |
||
| 973 | * Tests set_max_dewidow_pull. |
||
| 974 | * |
||
| 975 | * @covers ::set_max_dewidow_pull |
||
| 976 | */ |
||
| 977 | View Code Duplication | public function test_set_max_dewidow_pull() { |
|
| 987 | |||
| 988 | /** |
||
| 989 | * Tests set_wrap_hard_hyphens. |
||
| 990 | * |
||
| 991 | * @covers ::set_wrap_hard_hyphens |
||
| 992 | */ |
||
| 993 | View Code Duplication | public function test_set_wrap_hard_hyphens() { |
|
| 1000 | |||
| 1001 | /** |
||
| 1002 | * Tests set_url_wrap. |
||
| 1003 | * |
||
| 1004 | * @covers ::set_url_wrap |
||
| 1005 | */ |
||
| 1006 | View Code Duplication | public function test_set_url_wrap() { |
|
| 1013 | |||
| 1014 | /** |
||
| 1015 | * Tests set_email_wrap. |
||
| 1016 | * |
||
| 1017 | * @covers ::set_email_wrap |
||
| 1018 | */ |
||
| 1019 | View Code Duplication | public function test_set_email_wrap() { |
|
| 1026 | |||
| 1027 | /** |
||
| 1028 | * Tests set_min_after_url_wrap. |
||
| 1029 | * |
||
| 1030 | * @covers ::set_min_after_url_wrap |
||
| 1031 | */ |
||
| 1032 | View Code Duplication | public function test_set_min_after_url_wrap() { |
|
| 1042 | |||
| 1043 | /** |
||
| 1044 | * Tests set_style_ampersands. |
||
| 1045 | * |
||
| 1046 | * @covers ::set_style_ampersands |
||
| 1047 | */ |
||
| 1048 | View Code Duplication | public function test_set_style_ampersands() { |
|
| 1055 | |||
| 1056 | /** |
||
| 1057 | * Tests set_style_caps. |
||
| 1058 | * |
||
| 1059 | * @covers ::set_style_caps |
||
| 1060 | */ |
||
| 1061 | View Code Duplication | public function test_set_style_caps() { |
|
| 1068 | |||
| 1069 | /** |
||
| 1070 | * Tests set_style_initial_quotes. |
||
| 1071 | * |
||
| 1072 | * @covers ::set_style_initial_quotes |
||
| 1073 | */ |
||
| 1074 | View Code Duplication | public function test_set_style_initial_quotes() { |
|
| 1081 | |||
| 1082 | /** |
||
| 1083 | * Tests set_style_numbers. |
||
| 1084 | * |
||
| 1085 | * @covers ::set_style_numbers |
||
| 1086 | */ |
||
| 1087 | View Code Duplication | public function test_set_style_numbers() { |
|
| 1094 | |||
| 1095 | /** |
||
| 1096 | * Tests set_style_hanging_punctuation. |
||
| 1097 | * |
||
| 1098 | * @covers ::set_style_hanging_punctuation |
||
| 1099 | */ |
||
| 1100 | View Code Duplication | public function test_set_style_hanging_punctuation() { |
|
| 1107 | |||
| 1108 | /** |
||
| 1109 | * Tests set_initial_quote_tags. |
||
| 1110 | * |
||
| 1111 | * @covers ::set_initial_quote_tags |
||
| 1112 | */ |
||
| 1113 | public function test_set_initial_quote_tags() { |
||
| 1132 | |||
| 1133 | /** |
||
| 1134 | * Tests set_hyphenation. |
||
| 1135 | * |
||
| 1136 | * @covers ::set_hyphenation |
||
| 1137 | */ |
||
| 1138 | View Code Duplication | public function test_set_hyphenation() { |
|
| 1145 | |||
| 1146 | /** |
||
| 1147 | * Provide data for set_hyphenation_language testing. |
||
| 1148 | * |
||
| 1149 | * @return array |
||
| 1150 | */ |
||
| 1151 | public function provide_hyphenation_language_data() { |
||
| 1159 | |||
| 1160 | /** |
||
| 1161 | * Tests set_hyphenation_language. |
||
| 1162 | * |
||
| 1163 | * @covers ::set_hyphenation_language |
||
| 1164 | * |
||
| 1165 | * @uses PHP_Typography\Hyphenator::__construct |
||
| 1166 | * @uses PHP_Typography\Hyphenator::set_language |
||
| 1167 | * |
||
| 1168 | * @dataProvider provide_hyphenation_language_data |
||
| 1169 | * |
||
| 1170 | * @param string $lang Language code. |
||
| 1171 | * @param bool $success Expected success status. |
||
| 1172 | */ |
||
| 1173 | public function test_set_hyphenation_language( $lang, $success ) { |
||
| 1186 | |||
| 1187 | /** |
||
| 1188 | * Tests set_hyphenation_language. |
||
| 1189 | * |
||
| 1190 | * @covers ::set_hyphenation_language |
||
| 1191 | * |
||
| 1192 | * @uses PHP_Typography\Hyphenator::__construct |
||
| 1193 | * @uses PHP_Typography\Hyphenator::set_language |
||
| 1194 | * @uses PHP_Typography\Hyphenator\Trie_Node |
||
| 1195 | * |
||
| 1196 | * @dataProvider provide_hyphenation_language_data |
||
| 1197 | * |
||
| 1198 | * @param string $lang Language code. |
||
| 1199 | * @param bool $success Expected success status. |
||
| 1200 | */ |
||
| 1201 | public function test_set_hyphenation_language_again( $lang, $success ) { |
||
| 1220 | |||
| 1221 | |||
| 1222 | /** |
||
| 1223 | * Tests set_min_length_hyphenation. |
||
| 1224 | * |
||
| 1225 | * @covers ::set_min_length_hyphenation |
||
| 1226 | * |
||
| 1227 | * @uses PHP_Typography\Hyphenator::__construct |
||
| 1228 | */ |
||
| 1229 | View Code Duplication | public function test_set_min_length_hyphenation() { |
|
| 1239 | |||
| 1240 | /** |
||
| 1241 | * Tests set_min_before_hyphenation. |
||
| 1242 | * |
||
| 1243 | * @covers ::set_min_before_hyphenation |
||
| 1244 | */ |
||
| 1245 | View Code Duplication | public function test_set_min_before_hyphenation() { |
|
| 1256 | |||
| 1257 | /** |
||
| 1258 | * Tests set_min_after_hyphenation. |
||
| 1259 | * |
||
| 1260 | * @covers ::set_min_after_hyphenation |
||
| 1261 | */ |
||
| 1262 | View Code Duplication | public function test_set_min_after_hyphenation() { |
|
| 1272 | |||
| 1273 | /** |
||
| 1274 | * Tests set_hyphenate_headings. |
||
| 1275 | * |
||
| 1276 | * @covers ::set_hyphenate_headings |
||
| 1277 | */ |
||
| 1278 | View Code Duplication | public function test_set_hyphenate_headings() { |
|
| 1285 | |||
| 1286 | /** |
||
| 1287 | * Tests set_hyphenate_all_caps. |
||
| 1288 | * |
||
| 1289 | * @covers ::set_hyphenate_all_caps |
||
| 1290 | */ |
||
| 1291 | View Code Duplication | public function test_set_hyphenate_all_caps() { |
|
| 1298 | |||
| 1299 | /** |
||
| 1300 | * Tests set_hyphenate_title_case. |
||
| 1301 | * |
||
| 1302 | * @covers ::set_hyphenate_title_case |
||
| 1303 | */ |
||
| 1304 | View Code Duplication | public function test_set_hyphenate_title_case() { |
|
| 1311 | |||
| 1312 | /** |
||
| 1313 | * Tests set_hyphenate_compounds. |
||
| 1314 | * |
||
| 1315 | * @covers ::set_hyphenate_compounds |
||
| 1316 | */ |
||
| 1317 | View Code Duplication | public function test_set_hyphenate_compounds() { |
|
| 1324 | |||
| 1325 | /** |
||
| 1326 | * Tests set_hyphenation_exceptions. |
||
| 1327 | * |
||
| 1328 | * @covers ::set_hyphenation_exceptions |
||
| 1329 | * |
||
| 1330 | * @uses PHP_Typography\Hyphenator::__construct |
||
| 1331 | * @uses PHP_Typography\Hyphenator::set_custom_exceptions |
||
| 1332 | * @uses PHP_Typography\Strings::maybe_split_parameters |
||
| 1333 | */ |
||
| 1334 | public function test_set_hyphenation_exceptions_array() { |
||
| 1347 | |||
| 1348 | /** |
||
| 1349 | * Tests set_hyphenation_exceptions. |
||
| 1350 | * |
||
| 1351 | * @covers ::set_hyphenation_exceptions |
||
| 1352 | * |
||
| 1353 | * @uses PHP_Typography\Hyphenator::__construct |
||
| 1354 | * @uses PHP_Typography\Hyphenator::set_custom_exceptions |
||
| 1355 | * @uses PHP_Typography\Strings::maybe_split_parameters |
||
| 1356 | */ |
||
| 1357 | public function test_set_hyphenation_exceptions_string() { |
||
| 1365 | |||
| 1366 | /** |
||
| 1367 | * Tests get_hash. |
||
| 1368 | * |
||
| 1369 | * @covers ::get_hash |
||
| 1370 | */ |
||
| 1371 | public function test_get_hash() { |
||
| 1384 | |||
| 1385 | /** |
||
| 1386 | * Tests set_true_no_break_narrow_space and no_break_narrow_space. |
||
| 1387 | * |
||
| 1388 | * @covers ::set_true_no_break_narrow_space |
||
| 1389 | * @covers ::no_break_narrow_space |
||
| 1390 | */ |
||
| 1391 | public function test_set_true_no_break_narrow_space() { |
||
| 1400 | } |
||
| 1401 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..