Changeset 52010 for trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php
- Timestamp:
- 11/04/2021 03:22:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php
r51968 r52010 6 6 class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 7 7 8 function test_invalid_username_password() {8 public function test_invalid_username_password() { 9 9 $post = array(); 10 10 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'username', 'password', $post ) ); … … 13 13 } 14 14 15 function test_incapable_user() {15 public function test_incapable_user() { 16 16 $this->make_user_by_role( 'subscriber' ); 17 17 … … 22 22 } 23 23 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 24 public function test_no_content() { 35 25 $this->make_user_by_role( 'author' ); 36 26 … … 42 32 } 43 33 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 34 public function test_basic_content() { 55 35 $this->make_user_by_role( 'author' ); 56 36 … … 61 41 } 62 42 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 43 public function test_ignore_id() { 74 44 $this->make_user_by_role( 'author' ); 75 45 … … 83 53 } 84 54 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 55 public function test_capable_publish() { 96 56 $this->make_user_by_role( 'author' ); 97 57 … … 104 64 } 105 65 106 function test_incapable_publish() {66 public function test_incapable_publish() { 107 67 $this->make_user_by_role( 'contributor' ); 108 68 … … 116 76 } 117 77 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 78 public function test_capable_other_author() { 129 79 $this->make_user_by_role( 'editor' ); 130 80 $other_author_id = $this->make_user_by_role( 'author' ); … … 138 88 } 139 89 140 function test_incapable_other_author() {90 public function test_incapable_other_author() { 141 91 $this->make_user_by_role( 'contributor' ); 142 92 $other_author_id = $this->make_user_by_role( 'author' ); … … 154 104 * @ticket 20356 155 105 */ 156 function test_invalid_author() {106 public function test_invalid_author() { 157 107 $this->make_user_by_role( 'editor' ); 158 108 … … 166 116 } 167 117 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 118 public function test_empty_author() { 179 119 $my_author_id = $this->make_user_by_role( 'author' ); 180 120 … … 192 132 * @requires function imagejpeg 193 133 */ 194 function test_post_thumbnail() {134 public function test_post_thumbnail() { 195 135 add_theme_support( 'post-thumbnails' ); 196 136 … … 212 152 } 213 153 214 function test_incapable_set_post_type_as_page() {154 public function test_incapable_set_post_type_as_page() { 215 155 $this->make_user_by_role( 'author' ); 216 156 … … 224 164 } 225 165 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 166 public function test_capable_set_post_type_as_page() { 237 167 $this->make_user_by_role( 'editor' ); 238 168 … … 254 184 * @ticket 16985 255 185 */ 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 186 public function test_draft_post_date() { 267 187 $this->make_user_by_role( 'editor' ); 268 188
Note: See TracChangeset
for help on using the changeset viewer.