Changeset 51968 for trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php
- Timestamp:
- 11/01/2021 10:22:49 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.