Changeset 50339
- Timestamp:
- 02/13/2021 01:47:12 PM (4 years ago)
- Location:
- trunk/tests/phpunit/tests/general
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/general/paginateLinks.php
r50292 r50339 1 1 <?php 2 2 3 /** 4 * @group general 5 * @group template 6 * @covers ::paginate_links 7 */ 3 8 class Tests_General_PaginateLinks extends WP_UnitTestCase { 4 9 -
trunk/tests/phpunit/tests/general/template.php
r49992 r50339 3 3 * A set of unit tests for functions in wp-includes/general-template.php 4 4 * 5 * @group general 5 6 * @group template 6 7 * @group site_icon … … 34 35 /** 35 36 * @group site_icon 37 * @covers ::get_site_icon_url 36 38 */ 37 39 function test_get_site_icon_url() { … … 47 49 /** 48 50 * @group site_icon 51 * @covers ::site_icon_url 49 52 */ 50 53 function test_site_icon_url() { … … 59 62 /** 60 63 * @group site_icon 64 * @covers ::has_site_icon 61 65 */ 62 66 function test_has_site_icon() { … … 74 78 * @group multisite 75 79 * @group ms-required 80 * @covers ::has_site_icon 76 81 */ 77 82 function test_has_site_icon_returns_true_when_called_for_other_site_with_site_icon_set() { … … 88 93 * @group multisite 89 94 * @group ms-required 95 * @covers ::has_site_icon 90 96 */ 91 97 function test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set() { … … 97 103 /** 98 104 * @group site_icon 105 * @covers ::wp_site_icon 99 106 */ 100 107 function test_wp_site_icon() { … … 118 125 /** 119 126 * @group site_icon 127 * @covers ::wp_site_icon 120 128 */ 121 129 function test_wp_site_icon_with_filter() { … … 141 149 142 150 /** 143 * @group site_icon144 151 * @ticket 38377 152 * @group site_icon 153 * @covers ::wp_site_icon 145 154 */ 146 155 function test_customize_preview_wp_site_icon_empty() { … … 158 167 159 168 /** 160 * @group site_icon161 169 * @ticket 38377 170 * @group site_icon 171 * @covers ::wp_site_icon 162 172 */ 163 173 function test_customize_preview_wp_site_icon_dirty() { … … 242 252 /** 243 253 * @group custom_logo 254 * @covers ::has_custom_logo 244 255 * 245 256 * @since 4.5.0 … … 259 270 * @group multisite 260 271 * @group ms-required 272 * @covers ::has_custom_logo 261 273 */ 262 274 function test_has_custom_logo_returns_true_when_called_for_other_site_with_custom_logo_set() { … … 273 285 * @group multisite 274 286 * @group ms-required 287 * @covers ::has_custom_logo 275 288 */ 276 289 function test_has_custom_logo_returns_false_when_called_for_other_site_without_custom_logo_set() { … … 282 295 /** 283 296 * @group custom_logo 297 * @covers ::get_custom_logo 284 298 * 285 299 * @since 4.5.0 … … 301 315 * @group multisite 302 316 * @group ms-required 317 * @covers ::get_custom_logo 303 318 */ 304 319 function test_get_custom_logo_returns_logo_when_called_for_other_site_with_custom_logo_set() { … … 329 344 /** 330 345 * @group custom_logo 346 * @covers ::the_custom_logo 331 347 * 332 348 * @since 4.5.0 … … 356 372 357 373 /** 374 * @ticket 38768 358 375 * @group custom_logo 359 * @ ticket 38768376 * @covers ::the_custom_logo 360 377 */ 361 378 function test_the_custom_logo_with_alt() { … … 421 438 * @ticket 38253 422 439 * @group ms-required 440 * @covers ::get_site_icon_url 423 441 */ 424 442 function test_get_site_icon_url_preserves_switched_state() { … … 440 458 * @ticket 38253 441 459 * @group ms-required 460 * @covers ::has_custom_logo 442 461 */ 443 462 function test_has_custom_logo_preserves_switched_state() { … … 459 478 * @ticket 38253 460 479 * @group ms-required 480 * @covers ::get_custom_logo 461 481 */ 462 482 function test_get_custom_logo_preserves_switched_state() { … … 477 497 /** 478 498 * @ticket 40969 499 * 500 * @covers ::get_header 479 501 */ 480 502 function test_get_header_returns_nothing_on_success() { … … 488 510 /** 489 511 * @ticket 40969 512 * 513 * @covers ::get_footer 490 514 */ 491 515 function test_get_footer_returns_nothing_on_success() { … … 499 523 /** 500 524 * @ticket 40969 525 * 526 * @covers ::get_sidebar 501 527 */ 502 528 function test_get_sidebar_returns_nothing_on_success() { … … 510 536 /** 511 537 * @ticket 40969 538 * 539 * @covers ::get_template_part 512 540 */ 513 541 function test_get_template_part_returns_nothing_on_success() { … … 521 549 /** 522 550 * @ticket 40969 551 * 552 * @covers ::get_template_part 523 553 */ 524 554 function test_get_template_part_returns_false_on_failure() { … … 528 558 /** 529 559 * @ticket 21676 560 * 561 * @covers ::get_template_part 530 562 */ 531 563 function test_get_template_part_passes_arguments_to_template() { … … 538 570 * @ticket 9862 539 571 * @dataProvider data_selected_and_checked_with_equal_values 572 * 573 * @covers ::selected 574 * @covers ::checked 540 575 */ 541 576 function test_selected_and_checked_with_equal_values( $selected, $current ) { … … 562 597 * @ticket 9862 563 598 * @dataProvider data_selected_and_checked_with_non_equal_values 599 * 600 * @covers ::selected 601 * @covers ::checked 564 602 */ 565 603 function test_selected_and_checked_with_non_equal_values( $selected, $current ) { … … 578 616 /** 579 617 * @ticket 44183 618 * 619 * @covers ::get_the_archive_title 580 620 */ 581 621 function test_get_the_archive_title_is_correct_for_author_queries() { -
trunk/tests/phpunit/tests/general/wpError.php
r50292 r50339 6 6 * @group errors 7 7 * 8 * @covers WP_Error 8 9 * @coversDefaultClass WP_Error 9 10 */ … … 26 27 } 27 28 29 /** 30 * @covers ::__construct 31 */ 28 32 public function test_WP_Error_should_be_of_type_WP_Error() { 29 33 $this->assertWPError( $this->wp_error ); 30 34 } 31 35 36 /** 37 * @covers ::__construct 38 */ 32 39 public function test_WP_Error_with_default_empty_parameters_should_add_no_errors() { 33 40 $this->assertEmpty( $this->wp_error->errors ); 34 41 } 35 42 43 /** 44 * @covers ::__construct 45 * @covers ::get_error_code 46 */ 36 47 public function test_WP_Error_with_empty_code_should_add_no_code() { 37 48 $this->assertSame( '', $this->wp_error->get_error_code() ); 38 49 } 39 50 51 /** 52 * @covers ::__construct 53 * @covers ::get_error_message 54 */ 40 55 public function test_WP_Error_with_empty_code_should_add_no_message() { 41 56 $this->assertSame( '', $this->wp_error->get_error_message() ); 42 57 } 43 58 59 /** 60 * @covers ::__construct 61 */ 44 62 public function test_WP_Error_with_empty_code_should_add_no_error_data() { 45 63 $this->assertEmpty( $this->wp_error->error_data ); 46 64 } 47 65 66 /** 67 * @covers ::__construct 68 * @covers ::get_error_code 69 */ 48 70 public function test_WP_Error_with_code_and_empty_message_should_add_error_with_that_code() { 49 71 $wp_error = new WP_Error( 'code' ); … … 52 74 } 53 75 76 /** 77 * @covers ::__construct 78 * @covers ::get_error_message 79 */ 54 80 public function test_WP_Error_with_code_and_empty_message_should_add_error_with_that_code_and_empty_message() { 55 81 $wp_error = new WP_Error( 'code' ); … … 58 84 } 59 85 86 /** 87 * @covers ::__construct 88 * @covers ::get_error_data 89 */ 60 90 public function test_WP_Error_with_code_and_empty_message_and_empty_data_should_add_error_but_not_associated_data() { 61 91 $wp_error = new WP_Error( 'code' ); … … 64 94 } 65 95 96 /** 97 * @covers ::__construct 98 * @covers ::get_error_data 99 */ 66 100 public function test_WP_Error_with_code_and_empty_message_and_non_empty_data_should_add_error_with_empty_message_and_that_stored_data() { 67 101 $wp_error = new WP_Error( 'code', '', 'data' ); … … 70 104 } 71 105 106 /** 107 * @covers ::__construct 108 * @covers ::get_error_code 109 */ 72 110 public function test_WP_Error_with_code_and_message_should_add_error_with_that_code() { 73 111 $wp_error = new WP_Error( 'code', 'message' ); … … 76 114 } 77 115 116 /** 117 * @covers ::__construct 118 * @covers ::get_error_message 119 */ 78 120 public function test_WP_Error_with_code_and_message_should_add_error_with_that_message() { 79 121 $wp_error = new WP_Error( 'code', 'message' ); … … 82 124 } 83 125 126 /** 127 * @covers ::__construct 128 * @covers ::get_error_code 129 */ 84 130 public function test_WP_Error_with_code_and_message_and_data_should_add_error_with_that_code() { 85 131 $wp_error = new WP_Error( 'code', 'message', 'data' ); … … 88 134 } 89 135 136 /** 137 * @covers ::__construct 138 * @covers ::get_error_message 139 */ 90 140 public function test_WP_Error_with_code_and_message_and_data_should_add_error_with_that_message() { 91 141 $wp_error = new WP_Error( 'code', 'message', 'data' ); … … 94 144 } 95 145 146 /** 147 * @covers ::__construct 148 * @covers ::get_error_data 149 */ 96 150 public function test_WP_Error_with_code_and_message_and_data_should_add_error_with_that_data() { 97 151 $wp_error = new WP_Error( 'code', 'message', 'data' ); … … 101 155 102 156 /** 157 * @covers ::__construct 103 158 * @covers ::get_error_codes 104 159 */ … … 108 163 109 164 /** 165 * @covers ::add 110 166 * @covers ::get_error_codes 111 167 */ … … 117 173 118 174 /** 175 * @covers ::add 119 176 * @covers ::get_error_codes 120 177 */ … … 129 186 130 187 /** 188 * @covers ::__construct 131 189 * @covers ::get_error_code 132 190 */ … … 136 194 137 195 /** 196 * @covers ::add 138 197 * @covers ::get_error_code 139 198 */ … … 145 204 146 205 /** 206 * @covers ::add 147 207 * @covers ::get_error_code 148 208 */ … … 155 215 156 216 /** 217 * @covers ::__construct 157 218 * @covers ::get_error_messages 158 219 */ … … 162 223 163 224 /** 225 * @covers ::add 164 226 * @covers ::get_error_messages 165 227 */ … … 171 233 172 234 /** 235 * @covers ::add 173 236 * @covers ::get_error_messages 174 237 */ … … 181 244 182 245 /** 246 * @covers ::__construct 183 247 * @covers ::get_error_messages 184 248 */ … … 188 252 189 253 /** 254 * @covers ::add 190 255 * @covers ::get_error_messages 191 256 */ … … 197 262 198 263 /** 264 * @covers ::add 199 265 * @covers ::get_error_messages 200 266 */ … … 207 273 208 274 /** 275 * @covers ::__construct 209 276 * @covers ::get_error_message 210 277 */ … … 214 281 215 282 /** 283 * @covers ::add 216 284 * @covers ::get_error_message 217 285 */ … … 223 291 224 292 /** 293 * @covers ::add 225 294 * @covers ::get_error_message 226 295 */ … … 233 302 234 303 /** 304 * @covers ::add 235 305 * @covers ::get_error_message 236 306 */ … … 244 314 245 315 /** 316 * @covers ::__construct 246 317 * @covers ::get_error_message 247 318 */ … … 251 322 252 323 /** 324 * @covers ::add 253 325 * @covers ::get_error_message 254 326 */ … … 260 332 261 333 /** 334 * @covers ::add 262 335 * @covers ::get_error_message 263 336 */ … … 270 343 271 344 /** 345 * @covers ::__construct 272 346 * @covers ::get_error_data 273 347 */ … … 277 351 278 352 /** 353 * @covers ::add 279 354 * @covers ::get_error_data 280 355 */ … … 286 361 287 362 /** 363 * @covers ::add 288 364 * @covers ::get_error_data 289 365 */ … … 296 372 297 373 /** 374 * @covers ::add 298 375 * @covers ::get_error_data 299 376 */ … … 306 383 307 384 /** 385 * @covers ::add 308 386 * @covers ::get_error_data 309 387 */ … … 317 395 318 396 /** 397 * @covers ::add 319 398 * @covers ::get_error_data 320 399 */ … … 328 407 329 408 /** 409 * @covers ::__construct 330 410 * @covers ::get_error_data 331 411 */ … … 335 415 336 416 /** 417 * @covers ::add 337 418 * @covers ::get_error_data 338 419 */ … … 344 425 345 426 /** 427 * @covers ::add 346 428 * @covers ::get_error_data 347 429 */ … … 354 436 355 437 /** 438 * @covers ::add 356 439 * @covers ::get_error_data 357 440 */ … … 366 449 367 450 /** 451 * @covers ::add 368 452 * @covers ::get_error_data 369 453 */ … … 377 461 378 462 /** 463 * @covers ::__construct 379 464 * @covers ::get_all_error_data 380 465 */ … … 384 469 385 470 /** 471 * @covers ::add 386 472 * @covers ::get_all_error_data 387 473 */ … … 393 479 394 480 /** 481 * @covers ::add 395 482 * @covers ::get_all_error_data 396 483 */ … … 405 492 406 493 /** 494 * @covers ::add 407 495 * @covers ::get_all_error_data 408 496 */ … … 416 504 417 505 /** 506 * @covers ::add 418 507 * @covers ::get_all_error_data 419 508 */ … … 429 518 430 519 /** 520 * @covers ::__construct 431 521 * @covers ::has_errors 432 522 */ … … 436 526 437 527 /** 528 * @covers ::add 438 529 * @covers ::has_errors 439 530 */ … … 481 572 /** 482 573 * @covers ::add 574 * @covers ::get_error_code 483 575 */ 484 576 public function test_add_with_code_empty_message_empty_data_should_add_error_with_code() { … … 490 582 /** 491 583 * @covers ::add 584 * @covers ::get_error_message 492 585 */ 493 586 public function test_add_with_code_empty_message_empty_data_should_add_error_with_empty_message() { … … 499 592 /** 500 593 * @covers ::add 594 * @covers ::get_error_data 501 595 */ 502 596 public function test_add_with_code_empty_message_empty_data_should_not_add_error_data() { … … 508 602 /** 509 603 * @covers ::add 604 * @covers ::get_error_message 510 605 */ 511 606 public function test_add_with_code_and_message_and_empty_data_should_should_add_error_with_that_message() { … … 517 612 /** 518 613 * @covers ::add 614 * @covers ::get_error_data 519 615 */ 520 616 public function test_add_with_code_and_message_and_empty_data_should_not_alter_stored_data() { … … 526 622 /** 527 623 * @covers ::add 624 * @covers ::get_error_code 528 625 */ 529 626 public function test_add_with_code_and_empty_message_and_data_should_add_error_with_that_code() { … … 535 632 /** 536 633 * @covers ::add 634 * @covers ::get_error_data 537 635 */ 538 636 public function test_add_with_code_and_empty_message_and_data_should_store_that_data() { … … 544 642 /** 545 643 * @covers ::add 644 * @covers ::get_error_code 546 645 */ 547 646 public function test_add_with_code_and_message_and_data_should_add_an_error_with_that_code() { … … 553 652 /** 554 653 * @covers ::add 654 * @covers ::get_error_message 555 655 */ 556 656 public function test_add_with_code_and_message_and_data_should_add_an_error_with_that_message() { … … 562 662 /** 563 663 * @covers ::add 664 * @covers ::get_error_data 564 665 */ 565 666 public function test_add_with_code_and_message_and_data_should_store_that_data() { … … 571 672 /** 572 673 * @covers ::add 674 * @covers ::get_error_messages 573 675 */ 574 676 public function test_add_multiple_times_with_the_same_code_should_add_additional_messages_for_that_code() { … … 583 685 /** 584 686 * @covers ::add 687 * @covers ::get_error_data 585 688 */ 586 689 public function test_add_multiple_times_with_the_same_code_and_different_data_should_store_only_the_last_added_data() { … … 611 714 /** 612 715 * @covers ::add_data 716 * @covers ::get_error_data 613 717 */ 614 718 public function test_add_data_with_data_empty_code_and_one_error_should_store_the_data_under_that_code() { … … 621 725 /** 622 726 * @covers ::add_data 727 * @covers ::get_error_data 623 728 */ 624 729 public function test_add_data_with_data_empty_code_and_multiple_errors_with_different_codes_should_store_it_under_the_first_code() { … … 633 738 /** 634 739 * @covers ::add_data 740 * @covers ::get_error_data 635 741 */ 636 742 public function test_add_data_with_data_empty_code_and_multiple_errors_with_same_code_should_store_it_under_the_first_code() { … … 686 792 /** 687 793 * @covers ::add_data 794 * @covers ::get_error_data 688 795 */ 689 796 public function test_add_data_with_data_and_code_should_add_data() { … … 762 869 /** 763 870 * @covers ::remove 871 * @covers ::get_error_data 872 * @covers ::get_all_error_data 764 873 */ 765 874 public function test_remove_should_remove_the_error_data_associated_with_the_given_code() { … … 775 884 776 885 /** 777 * @covers ::merge_from() 886 * @covers ::merge_from 887 * @covers ::get_error_messages 888 * @covers ::get_error_data 889 * @covers ::get_all_error_data 890 * @covers ::get_error_message 778 891 */ 779 892 public function test_merge_from_should_copy_other_error_into_instance() { … … 791 904 792 905 /** 793 * @covers ::merge_from() 906 * @covers ::merge_from 907 * @covers ::has_errors 794 908 */ 795 909 public function test_merge_from_with_no_errors_should_not_add_to_instance() { … … 802 916 803 917 /** 804 * @covers ::export_to() 918 * @covers ::export_to 919 * @covers ::get_error_messages 920 * @covers ::get_error_data 921 * @covers ::get_all_error_data 922 * @covers ::get_error_message 805 923 */ 806 924 public function test_export_to_should_copy_instance_into_other_error() { … … 820 938 821 939 /** 822 * @covers ::export_to() 940 * @covers ::export_to 941 * @covers ::has_errors 823 942 */ 824 943 public function test_export_to_with_no_errors_should_not_add_to_other_error() { -
trunk/tests/phpunit/tests/general/wpGetArchives.php
r50292 r50339 3 3 /** 4 4 * @group general 5 * @group template 6 * @covers ::wp_get_archives 5 7 */ 6 8 class Tests_General_wpGetArchives extends WP_UnitTestCase { -
trunk/tests/phpunit/tests/general/wpGetDocumentTitle.php
r50292 r50339 4 4 * A set of unit tests for functions in wp-includes/general-template.php 5 5 * 6 * @group general 6 7 * @group template 7 8 * @group document-title 9 * @covers ::wp_get_document_title 10 * @covers ::_wp_render_title_tag 8 11 */ 9 12 class Tests_General_wpGetDocumentTitle extends WP_UnitTestCase { -
trunk/tests/phpunit/tests/general/wpResourceHints.php
r50337 r50339 2 2 3 3 /** 4 * @group general 4 5 * @group template 5 6 * @ticket 34292 7 * @covers ::wp_resource_hints 6 8 */ 7 9 class Tests_General_wpResourceHints extends WP_UnitTestCase {
Note: See TracChangeset
for help on using the changeset viewer.