Changeset 51968
- Timestamp:
- 11/01/2021 10:22:49 PM (3 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesListTable.php
r51657 r51968 186 186 */ 187 187 protected function _test_list_hierarchical_page( array $args, array $expected_ids ) { 188 if ( PHP_VERSION_ID >= 80100 ) { 189 /* 190 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 191 * via hooked in filter functions until a more structural solution to the 192 * "missing input validation" conundrum has been architected and implemented. 193 */ 194 $this->expectDeprecation(); 195 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 196 } 197 188 198 $matches = array(); 189 199 … … 206 216 } 207 217 218 // Effectively ignore the output until retrieving it later via `getActualOutput()`. 219 $this->expectOutputRegex( '`.`' ); 220 208 221 $pages = new WP_Query( $args ); 209 222 210 ob_start();211 223 $this->table->set_hierarchical_display( true ); 212 224 $this->table->display_rows( $pages->posts ); 213 $output = ob_get_clean();225 $output = $this->getActualOutput(); 214 226 215 227 // Clean up. -
trunk/tests/phpunit/tests/admin/includesPost.php
r51639 r51968 877 877 */ 878 878 public function test_post_exists_should_support_post_type() { 879 if ( PHP_VERSION_ID >= 80100 ) { 880 /* 881 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 882 * via hooked in filter functions until a more structural solution to the 883 * "missing input validation" conundrum has been architected and implemented. 884 */ 885 $this->expectDeprecation(); 886 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 887 } 888 879 889 $title = 'Foo Bar'; 880 890 $post_type = 'page'; … … 894 904 */ 895 905 public function test_post_exists_should_not_match_a_page_for_post() { 906 if ( PHP_VERSION_ID >= 80100 ) { 907 /* 908 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 909 * via hooked in filter functions until a more structural solution to the 910 * "missing input validation" conundrum has been architected and implemented. 911 */ 912 $this->expectDeprecation(); 913 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 914 } 915 896 916 $title = 'Foo Bar'; 897 917 $post_type = 'page'; … … 911 931 */ 912 932 public function test_post_exists_should_support_post_status() { 933 if ( PHP_VERSION_ID >= 80100 ) { 934 /* 935 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 936 * via hooked in filter functions until a more structural solution to the 937 * "missing input validation" conundrum has been architected and implemented. 938 */ 939 $this->expectDeprecation(); 940 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 941 } 942 913 943 $title = 'Foo Bar'; 914 944 $post_type = 'post'; … … 931 961 */ 932 962 public function test_post_exists_should_support_post_type_status_combined() { 963 if ( PHP_VERSION_ID >= 80100 ) { 964 /* 965 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 966 * via hooked in filter functions until a more structural solution to the 967 * "missing input validation" conundrum has been architected and implemented. 968 */ 969 $this->expectDeprecation(); 970 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 971 } 972 933 973 $title = 'Foo Bar'; 934 974 $post_type = 'post'; … … 950 990 */ 951 991 public function test_post_exists_should_only_match_correct_post_status() { 992 if ( PHP_VERSION_ID >= 80100 ) { 993 /* 994 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 995 * via hooked in filter functions until a more structural solution to the 996 * "missing input validation" conundrum has been architected and implemented. 997 */ 998 $this->expectDeprecation(); 999 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 1000 } 1001 952 1002 $title = 'Foo Bar'; 953 1003 $post_type = 'post'; … … 969 1019 */ 970 1020 public function test_post_exists_should_not_match_invalid_post_type_and_status_combined() { 1021 if ( PHP_VERSION_ID >= 80100 ) { 1022 /* 1023 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 1024 * via hooked in filter functions until a more structural solution to the 1025 * "missing input validation" conundrum has been architected and implemented. 1026 */ 1027 $this->expectDeprecation(); 1028 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 1029 } 1030 971 1031 $title = 'Foo Bar'; 972 1032 $post_type = 'post'; -
trunk/tests/phpunit/tests/comment-submission.php
r51568 r51968 201 201 202 202 public function test_submitting_comment_to_password_protected_post_succeeds() { 203 if ( PHP_VERSION_ID >= 80100 ) { 204 /* 205 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 206 * via hooked in filter functions until a more structural solution to the 207 * "missing input validation" conundrum has been architected and implemented. 208 */ 209 $this->expectDeprecation(); 210 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 211 } 203 212 204 213 $password = 'password'; … … 283 292 */ 284 293 public function test_submitting_comment_handles_slashes_correctly_handles_slashes() { 294 if ( PHP_VERSION_ID >= 80100 ) { 295 /* 296 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 297 * via hooked in filter functions until a more structural solution to the 298 * "missing input validation" conundrum has been architected and implemented. 299 */ 300 $this->expectDeprecation(); 301 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 302 } 285 303 286 304 $data = array( … … 430 448 431 449 public function test_anonymous_user_cannot_comment_unfiltered_html() { 450 if ( PHP_VERSION_ID >= 80100 ) { 451 /* 452 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 453 * via hooked in filter functions until a more structural solution to the 454 * "missing input validation" conundrum has been architected and implemented. 455 */ 456 $this->expectDeprecation(); 457 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 458 } 432 459 433 460 $data = array( … … 720 747 */ 721 748 public function test_submitting_comment_with_empty_type_results_in_correct_type() { 749 if ( PHP_VERSION_ID >= 80100 ) { 750 /* 751 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 752 * via hooked in filter functions until a more structural solution to the 753 * "missing input validation" conundrum has been architected and implemented. 754 */ 755 $this->expectDeprecation(); 756 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 757 } 758 722 759 $data = array( 723 760 'comment_post_ID' => self::$post->ID, … … 803 840 */ 804 841 public function test_submitting_duplicate_comments() { 842 if ( PHP_VERSION_ID >= 80100 ) { 843 /* 844 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 845 * via hooked in filter functions until a more structural solution to the 846 * "missing input validation" conundrum has been architected and implemented. 847 */ 848 $this->expectDeprecation(); 849 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 850 } 851 805 852 $data = array( 806 853 'comment_post_ID' => self::$post->ID, … … 819 866 */ 820 867 public function test_comments_flood() { 868 if ( PHP_VERSION_ID >= 80100 ) { 869 /* 870 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 871 * via hooked in filter functions until a more structural solution to the 872 * "missing input validation" conundrum has been architected and implemented. 873 */ 874 $this->expectDeprecation(); 875 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 876 } 877 821 878 $data = array( 822 879 'comment_post_ID' => self::$post->ID, -
trunk/tests/phpunit/tests/date/xmlrpc.php
r50279 r51968 15 15 */ 16 16 public function test_date_new_post() { 17 if ( PHP_VERSION_ID >= 80100 ) { 18 /* 19 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 20 * via hooked in filter functions until a more structural solution to the 21 * "missing input validation" conundrum has been architected and implemented. 22 */ 23 $this->expectDeprecation(); 24 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 25 } 26 17 27 $timezone = 'Europe/Kiev'; 18 28 update_option( 'timezone_string', $timezone ); -
trunk/tests/phpunit/tests/dependencies/scripts.php
r51576 r51968 721 721 $wp_scripts->base_url = ''; 722 722 $wp_scripts->do_concat = true; 723 724 if ( PHP_VERSION_ID >= 80100 ) { 725 /* 726 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 727 * via hooked in filter functions until a more structural solution to the 728 * "missing input validation" conundrum has been architected and implemented. 729 */ 730 $this->expectDeprecation(); 731 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 732 } 723 733 724 734 $ver = get_bloginfo( 'version' ); … … 747 757 wp_add_inline_script( 'test-example2', 'console.log("after");', 'after' ); 748 758 749 $print_scripts = get_echo( 'wp_print_scripts' ); 750 $print_scripts .= get_echo( '_print_scripts' ); 759 // Effectively ignore the output until retrieving it later via `getActualOutput()`. 760 $this->expectOutputRegex( '`.`' ); 761 762 wp_print_scripts(); 763 _print_scripts(); 764 $print_scripts = $this->getActualOutput(); 751 765 752 766 /* … … 777 791 $wp_scripts->do_concat = true; 778 792 793 if ( PHP_VERSION_ID >= 80100 ) { 794 /* 795 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 796 * via hooked in filter functions until a more structural solution to the 797 * "missing input validation" conundrum has been architected and implemented. 798 */ 799 $this->expectDeprecation(); 800 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 801 } 802 779 803 $expected_tail = "<script type='text/javascript' src='/customize-dependency.js' id='customize-dependency-js'></script>\n"; 780 804 $expected_tail .= "<script type='text/javascript' id='customize-dependency-js-after'>\n"; … … 786 810 wp_add_inline_script( $handle, 'tryCustomizeDependency()' ); 787 811 788 $print_scripts = get_echo( 'wp_print_scripts' ); 789 $print_scripts .= get_echo( '_print_scripts' ); 812 // Effectively ignore the output until retrieving it later via `getActualOutput()`. 813 $this->expectOutputRegex( '`.`' ); 814 815 wp_print_scripts(); 816 _print_scripts(); 817 $print_scripts = $this->getActualOutput(); 790 818 791 819 $tail = substr( $print_scripts, strrpos( $print_scripts, "<script type='text/javascript' src='/customize-dependency.js' id='customize-dependency-js'>" ) ); -
trunk/tests/phpunit/tests/formatting/wpRelNofollow.php
r51623 r51968 10 10 */ 11 11 public function test_add_no_follow() { 12 if ( PHP_VERSION_ID >= 80100 ) { 13 /* 14 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 15 * via hooked in filter functions until a more structural solution to the 16 * "missing input validation" conundrum has been architected and implemented. 17 */ 18 $this->expectDeprecation(); 19 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 20 } 21 12 22 $content = '<p>This is some cool <a href="/">Code</a></p>'; 13 23 $expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow\">Code</a></p>'; … … 19 29 */ 20 30 public function test_convert_no_follow() { 31 if ( PHP_VERSION_ID >= 80100 ) { 32 /* 33 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 34 * via hooked in filter functions until a more structural solution to the 35 * "missing input validation" conundrum has been architected and implemented. 36 */ 37 $this->expectDeprecation(); 38 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 39 } 40 21 41 $content = '<p>This is some cool <a href="/" rel="weird">Code</a></p>'; 22 42 $expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow\">Code</a></p>'; … … 28 48 * @dataProvider data_wp_rel_nofollow 29 49 */ 30 public function test_wp_rel_nofollow( $input, $output ) { 31 return $this->assertSame( wp_slash( $output ), wp_rel_nofollow( $input ) ); 50 public function test_wp_rel_nofollow( $input, $output, $expect_deprecation = false ) { 51 if ( true === $expect_deprecation && PHP_VERSION_ID >= 80100 ) { 52 /* 53 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 54 * via hooked in filter functions until a more structural solution to the 55 * "missing input validation" conundrum has been architected and implemented. 56 */ 57 $this->expectDeprecation(); 58 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 59 } 60 61 $this->assertSame( wp_slash( $output ), wp_rel_nofollow( $input ) ); 32 62 } 33 63 … … 40 70 '<a href="">Double Quotes</a>', 41 71 '<a href="" rel="nofollow">Double Quotes</a>', 72 true, 42 73 ), 43 74 array( … … 77 108 78 109 public function test_append_no_follow_with_valueless_attribute() { 110 if ( PHP_VERSION_ID >= 80100 ) { 111 /* 112 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 113 * via hooked in filter functions until a more structural solution to the 114 * "missing input validation" conundrum has been architected and implemented. 115 */ 116 $this->expectDeprecation(); 117 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 118 } 119 79 120 $content = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>'; 80 121 $expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow\">Code</a></p>'; -
trunk/tests/phpunit/tests/formatting/wpRelUgc.php
r51623 r51968 10 10 */ 11 11 public function test_add_ugc() { 12 if ( PHP_VERSION_ID >= 80100 ) { 13 /* 14 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 15 * via hooked in filter functions until a more structural solution to the 16 * "missing input validation" conundrum has been architected and implemented. 17 */ 18 $this->expectDeprecation(); 19 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 20 } 21 12 22 $content = '<p>This is some cool <a href="/">Code</a></p>'; 13 23 $expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow ugc\">Code</a></p>'; … … 19 29 */ 20 30 public function test_convert_ugc() { 31 if ( PHP_VERSION_ID >= 80100 ) { 32 /* 33 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 34 * via hooked in filter functions until a more structural solution to the 35 * "missing input validation" conundrum has been architected and implemented. 36 */ 37 $this->expectDeprecation(); 38 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 39 } 40 21 41 $content = '<p>This is some cool <a href="/" rel="weird">Code</a></p>'; 22 42 $expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow ugc\">Code</a></p>'; … … 28 48 * @dataProvider data_wp_rel_ugc 29 49 */ 30 public function test_wp_rel_ugc( $input, $output ) { 31 return $this->assertSame( wp_slash( $output ), wp_rel_ugc( $input ) ); 50 public function test_wp_rel_ugc( $input, $output, $expect_deprecation = false ) { 51 if ( true === $expect_deprecation && PHP_VERSION_ID >= 80100 ) { 52 /* 53 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 54 * via hooked in filter functions until a more structural solution to the 55 * "missing input validation" conundrum has been architected and implemented. 56 */ 57 $this->expectDeprecation(); 58 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 59 } 60 61 $this->assertSame( wp_slash( $output ), wp_rel_ugc( $input ) ); 32 62 } 33 63 … … 40 70 '<a href="">Double Quotes</a>', 41 71 '<a href="" rel="nofollow ugc">Double Quotes</a>', 72 true, 42 73 ), 43 74 array( … … 77 108 78 109 public function test_append_ugc_with_valueless_attribute() { 110 if ( PHP_VERSION_ID >= 80100 ) { 111 /* 112 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 113 * via hooked in filter functions until a more structural solution to the 114 * "missing input validation" conundrum has been architected and implemented. 115 */ 116 $this->expectDeprecation(); 117 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 118 } 119 79 120 $content = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>'; 80 121 $expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow ugc\">Code</a></p>'; -
trunk/tests/phpunit/tests/formatting/wpTrimExcerpt.php
r51623 r51968 72 72 */ 73 73 public function test_should_generate_excerpt_for_empty_values() { 74 if ( PHP_VERSION_ID >= 80100 ) { 75 /* 76 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 77 * via hooked in filter functions until a more structural solution to the 78 * "missing input validation" conundrum has been architected and implemented. 79 */ 80 $this->expectDeprecation(); 81 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 82 } 83 74 84 $post = self::factory()->post->create( 75 85 array( -
trunk/tests/phpunit/tests/term/wpGenerateTagCloud.php
r51565 r51968 264 264 */ 265 265 public function test_should_include_tag_link_position_class() { 266 if ( PHP_VERSION_ID >= 80100 ) { 267 /* 268 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 269 * via hooked in filter functions until a more structural solution to the 270 * "missing input validation" conundrum has been architected and implemented. 271 */ 272 $this->expectDeprecation(); 273 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 274 } 275 266 276 register_taxonomy( 'wptests_tax', 'post' ); 267 277 $term_ids = self::factory()->term->create_many( 3, array( 'taxonomy' => 'wptests_tax' ) ); -
trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php
r51587 r51968 302 302 */ 303 303 function test_draft_not_prematurely_published() { 304 if ( PHP_VERSION_ID >= 80100 ) { 305 /* 306 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 307 * via hooked in filter functions until a more structural solution to the 308 * "missing input validation" conundrum has been architected and implemented. 309 */ 310 $this->expectDeprecation(); 311 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 312 } 313 304 314 $editor_id = $this->make_user_by_role( 'editor' ); 305 315 -
trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php
r51415 r51968 23 23 24 24 function test_no_content() { 25 if ( PHP_VERSION_ID >= 80100 ) { 26 /* 27 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 28 * via hooked in filter functions until a more structural solution to the 29 * "missing input validation" conundrum has been architected and implemented. 30 */ 31 $this->expectDeprecation(); 32 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 33 } 34 25 35 $this->make_user_by_role( 'author' ); 26 36 … … 33 43 34 44 function test_basic_content() { 45 if ( PHP_VERSION_ID >= 80100 ) { 46 /* 47 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 48 * via hooked in filter functions until a more structural solution to the 49 * "missing input validation" conundrum has been architected and implemented. 50 */ 51 $this->expectDeprecation(); 52 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 53 } 54 35 55 $this->make_user_by_role( 'author' ); 36 56 … … 42 62 43 63 function test_ignore_id() { 64 if ( PHP_VERSION_ID >= 80100 ) { 65 /* 66 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 67 * via hooked in filter functions until a more structural solution to the 68 * "missing input validation" conundrum has been architected and implemented. 69 */ 70 $this->expectDeprecation(); 71 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 72 } 73 44 74 $this->make_user_by_role( 'author' ); 45 75 … … 54 84 55 85 function test_capable_publish() { 86 if ( PHP_VERSION_ID >= 80100 ) { 87 /* 88 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 89 * via hooked in filter functions until a more structural solution to the 90 * "missing input validation" conundrum has been architected and implemented. 91 */ 92 $this->expectDeprecation(); 93 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 94 } 95 56 96 $this->make_user_by_role( 'author' ); 57 97 … … 77 117 78 118 function test_capable_other_author() { 119 if ( PHP_VERSION_ID >= 80100 ) { 120 /* 121 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 122 * via hooked in filter functions until a more structural solution to the 123 * "missing input validation" conundrum has been architected and implemented. 124 */ 125 $this->expectDeprecation(); 126 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 127 } 128 79 129 $this->make_user_by_role( 'editor' ); 80 130 $other_author_id = $this->make_user_by_role( 'author' ); … … 117 167 118 168 function test_empty_author() { 169 if ( PHP_VERSION_ID >= 80100 ) { 170 /* 171 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 172 * via hooked in filter functions until a more structural solution to the 173 * "missing input validation" conundrum has been architected and implemented. 174 */ 175 $this->expectDeprecation(); 176 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 177 } 178 119 179 $my_author_id = $this->make_user_by_role( 'author' ); 120 180 … … 165 225 166 226 function test_capable_set_post_type_as_page() { 227 if ( PHP_VERSION_ID >= 80100 ) { 228 /* 229 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 230 * via hooked in filter functions until a more structural solution to the 231 * "missing input validation" conundrum has been architected and implemented. 232 */ 233 $this->expectDeprecation(); 234 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 235 } 236 167 237 $this->make_user_by_role( 'editor' ); 168 238 … … 185 255 */ 186 256 function test_draft_post_date() { 257 if ( PHP_VERSION_ID >= 80100 ) { 258 /* 259 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 260 * via hooked in filter functions until a more structural solution to the 261 * "missing input validation" conundrum has been architected and implemented. 262 */ 263 $this->expectDeprecation(); 264 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 265 } 266 187 267 $this->make_user_by_role( 'editor' ); 188 268 -
trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php
r51587 r51968 469 469 */ 470 470 function test_draft_not_prematurely_published() { 471 if ( PHP_VERSION_ID >= 80100 ) { 472 /* 473 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 474 * via hooked in filter functions until a more structural solution to the 475 * "missing input validation" conundrum has been architected and implemented. 476 */ 477 $this->expectDeprecation(); 478 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 479 } 480 471 481 $editor_id = $this->make_user_by_role( 'editor' ); 472 482 … … 505 515 */ 506 516 function test_draft_not_assigned_published_date() { 517 if ( PHP_VERSION_ID >= 80100 ) { 518 /* 519 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 520 * via hooked in filter functions until a more structural solution to the 521 * "missing input validation" conundrum has been architected and implemented. 522 */ 523 $this->expectDeprecation(); 524 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 525 } 526 507 527 $editor_id = $this->make_user_by_role( 'editor' ); 508 528 -
trunk/tests/phpunit/tests/xmlrpc/wp/getRevisions.php
r51331 r51968 61 61 */ 62 62 function test_revision_count_for_auto_draft_post_creation() { 63 if ( PHP_VERSION_ID >= 80100 ) { 64 /* 65 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 66 * via hooked in filter functions until a more structural solution to the 67 * "missing input validation" conundrum has been architected and implemented. 68 */ 69 $this->expectDeprecation(); 70 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 71 } 72 63 73 $this->make_user_by_role( 'editor' ); 64 74 -
trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php
r51415 r51968 21 21 22 22 function test_no_content() { 23 if ( PHP_VERSION_ID >= 80100 ) { 24 /* 25 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 26 * via hooked in filter functions until a more structural solution to the 27 * "missing input validation" conundrum has been architected and implemented. 28 */ 29 $this->expectDeprecation(); 30 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 31 } 32 23 33 $this->make_user_by_role( 'author' ); 24 34 … … 30 40 31 41 function test_basic_content() { 42 if ( PHP_VERSION_ID >= 80100 ) { 43 /* 44 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 45 * via hooked in filter functions until a more structural solution to the 46 * "missing input validation" conundrum has been architected and implemented. 47 */ 48 $this->expectDeprecation(); 49 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 50 } 51 32 52 $this->make_user_by_role( 'author' ); 33 53 … … 39 59 40 60 function test_ignore_id() { 61 if ( PHP_VERSION_ID >= 80100 ) { 62 /* 63 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 64 * via hooked in filter functions until a more structural solution to the 65 * "missing input validation" conundrum has been architected and implemented. 66 */ 67 $this->expectDeprecation(); 68 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 69 } 70 41 71 $this->make_user_by_role( 'author' ); 42 72 … … 51 81 52 82 function test_capable_publish() { 83 if ( PHP_VERSION_ID >= 80100 ) { 84 /* 85 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 86 * via hooked in filter functions until a more structural solution to the 87 * "missing input validation" conundrum has been architected and implemented. 88 */ 89 $this->expectDeprecation(); 90 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 91 } 92 53 93 $this->make_user_by_role( 'author' ); 54 94 … … 74 114 75 115 function test_capable_private() { 116 if ( PHP_VERSION_ID >= 80100 ) { 117 /* 118 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 119 * via hooked in filter functions until a more structural solution to the 120 * "missing input validation" conundrum has been architected and implemented. 121 */ 122 $this->expectDeprecation(); 123 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 124 } 125 76 126 $this->make_user_by_role( 'editor' ); 77 127 … … 97 147 98 148 function test_capable_other_author() { 149 if ( PHP_VERSION_ID >= 80100 ) { 150 /* 151 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 152 * via hooked in filter functions until a more structural solution to the 153 * "missing input validation" conundrum has been architected and implemented. 154 */ 155 $this->expectDeprecation(); 156 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 157 } 158 99 159 $other_author_id = $this->make_user_by_role( 'author' ); 100 160 $this->make_user_by_role( 'editor' ); … … 134 194 135 195 function test_empty_author() { 196 if ( PHP_VERSION_ID >= 80100 ) { 197 /* 198 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 199 * via hooked in filter functions until a more structural solution to the 200 * "missing input validation" conundrum has been architected and implemented. 201 */ 202 $this->expectDeprecation(); 203 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 204 } 205 136 206 $my_author_id = $this->make_user_by_role( 'author' ); 137 207 … … 170 240 171 241 function test_invalid_post_status() { 242 if ( PHP_VERSION_ID >= 80100 ) { 243 /* 244 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 245 * via hooked in filter functions until a more structural solution to the 246 * "missing input validation" conundrum has been architected and implemented. 247 */ 248 $this->expectDeprecation(); 249 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 250 } 251 172 252 $this->make_user_by_role( 'author' ); 173 253 … … 194 274 195 275 function test_capable_sticky() { 276 if ( PHP_VERSION_ID >= 80100 ) { 277 /* 278 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 279 * via hooked in filter functions until a more structural solution to the 280 * "missing input validation" conundrum has been architected and implemented. 281 */ 282 $this->expectDeprecation(); 283 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 284 } 285 196 286 $this->make_user_by_role( 'editor' ); 197 287 … … 219 309 220 310 function test_post_format() { 311 if ( PHP_VERSION_ID >= 80100 ) { 312 /* 313 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 314 * via hooked in filter functions until a more structural solution to the 315 * "missing input validation" conundrum has been architected and implemented. 316 */ 317 $this->expectDeprecation(); 318 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 319 } 320 221 321 $this->make_user_by_role( 'editor' ); 222 322 … … 231 331 232 332 function test_invalid_post_format() { 333 if ( PHP_VERSION_ID >= 80100 ) { 334 /* 335 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 336 * via hooked in filter functions until a more structural solution to the 337 * "missing input validation" conundrum has been architected and implemented. 338 */ 339 $this->expectDeprecation(); 340 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 341 } 342 233 343 $this->make_user_by_role( 'editor' ); 234 344 … … 281 391 282 392 function test_terms() { 393 if ( PHP_VERSION_ID >= 80100 ) { 394 /* 395 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 396 * via hooked in filter functions until a more structural solution to the 397 * "missing input validation" conundrum has been architected and implemented. 398 */ 399 $this->expectDeprecation(); 400 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 401 } 402 283 403 $this->make_user_by_role( 'editor' ); 284 404 … … 306 426 307 427 function test_terms_names() { 428 if ( PHP_VERSION_ID >= 80100 ) { 429 /* 430 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 431 * via hooked in filter functions until a more structural solution to the 432 * "missing input validation" conundrum has been architected and implemented. 433 */ 434 $this->expectDeprecation(); 435 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 436 } 437 308 438 $this->make_user_by_role( 'editor' ); 309 439 … … 349 479 */ 350 480 function test_invalid_post_date_does_not_fatal() { 481 if ( PHP_VERSION_ID >= 80100 ) { 482 /* 483 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 484 * via hooked in filter functions until a more structural solution to the 485 * "missing input validation" conundrum has been architected and implemented. 486 */ 487 $this->expectDeprecation(); 488 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 489 } 490 351 491 $this->make_user_by_role( 'author' ); 352 492 $date_string = 'invalid_date'; … … 366 506 */ 367 507 function test_invalid_post_date_gmt_does_not_fatal() { 508 if ( PHP_VERSION_ID >= 80100 ) { 509 /* 510 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 511 * via hooked in filter functions until a more structural solution to the 512 * "missing input validation" conundrum has been architected and implemented. 513 */ 514 $this->expectDeprecation(); 515 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 516 } 517 368 518 $this->make_user_by_role( 'author' ); 369 519 $date_string = 'invalid_date'; … … 383 533 */ 384 534 function test_valid_string_post_date() { 535 if ( PHP_VERSION_ID >= 80100 ) { 536 /* 537 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 538 * via hooked in filter functions until a more structural solution to the 539 * "missing input validation" conundrum has been architected and implemented. 540 */ 541 $this->expectDeprecation(); 542 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 543 } 544 385 545 $this->make_user_by_role( 'author' ); 386 546 $date_string = '1984-01-11 05:00:00'; … … 400 560 */ 401 561 function test_valid_string_post_date_gmt() { 562 if ( PHP_VERSION_ID >= 80100 ) { 563 /* 564 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 565 * via hooked in filter functions until a more structural solution to the 566 * "missing input validation" conundrum has been architected and implemented. 567 */ 568 $this->expectDeprecation(); 569 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 570 } 571 402 572 $this->make_user_by_role( 'author' ); 403 573 $date_string = '1984-01-11 05:00:00'; … … 417 587 */ 418 588 function test_valid_IXR_post_date() { 589 if ( PHP_VERSION_ID >= 80100 ) { 590 /* 591 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 592 * via hooked in filter functions until a more structural solution to the 593 * "missing input validation" conundrum has been architected and implemented. 594 */ 595 $this->expectDeprecation(); 596 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 597 } 598 419 599 $this->make_user_by_role( 'author' ); 420 600 $date_string = '1984-01-11 05:00:00'; … … 434 614 */ 435 615 function test_valid_IXR_post_date_gmt() { 616 if ( PHP_VERSION_ID >= 80100 ) { 617 /* 618 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 619 * via hooked in filter functions until a more structural solution to the 620 * "missing input validation" conundrum has been architected and implemented. 621 */ 622 $this->expectDeprecation(); 623 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 624 } 625 436 626 $this->make_user_by_role( 'author' ); 437 627 $date_string = '1984-01-11 05:00:00';
Note: See TracChangeset
for help on using the changeset viewer.