-
From d73896a2241992f342d5388b5674a69f5cfc59d0 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Mon, 24 Aug 2020 17:14:12 +0200
Subject: [PATCH] Tests: use clean `@covers` tags
The `()` at the end if unnecessary and disregarded by PHPUnit, so can be removed.
---
.../phpunit/tests/admin/includesTemplate.php | 4 +-
.../tests/admin/wpPrivacyRequestsTable.php | 2 +-
tests/phpunit/tests/ajax/CustomizeManager.php | 16 +--
tests/phpunit/tests/ajax/CustomizeMenus.php | 4 +-
.../tests/customize/custom-css-setting.php | 14 +-
tests/phpunit/tests/customize/manager.php | 78 +++++------
.../tests/customize/nav-menu-item-setting.php | 4 +-
tests/phpunit/tests/customize/nav-menus.php | 12 +-
tests/phpunit/tests/dependencies/scripts.php | 8 +-
tests/phpunit/tests/general/wpError.php | 128 +++++++++---------
tests/phpunit/tests/post/nav-menu.php | 2 +-
tests/phpunit/tests/post/types.php | 12 +-
.../rest-block-renderer-controller.php | 16 +--
.../tests/rest-api/rest-posts-controller.php | 2 +-
tests/phpunit/tests/theme.php | 2 +-
tests/phpunit/tests/widgets.php | 22 +--
.../tests/widgets/media-audio-widget.php | 2 +-
.../tests/widgets/media-gallery-widget.php | 10 +-
.../tests/widgets/media-image-widget.php | 2 +-
.../tests/widgets/media-video-widget.php | 16 +--
tests/phpunit/tests/widgets/media-widget.php | 22 +--
tests/phpunit/tests/widgets/text-widget.php | 4 +-
22 files changed, 191 insertions(+), 191 deletions(-)
diff --git a/tests/phpunit/tests/admin/includesTemplate.php b/tests/phpunit/tests/admin/includesTemplate.php
index a944615b8d..82f7ad3332 100644
|
a
|
b
|
class Tests_Admin_includesTemplate extends WP_UnitTestCase { |
| 131 | 131 | * Test calling get_settings_errors() with variations on where it gets errors from. |
| 132 | 132 | * |
| 133 | 133 | * @ticket 42498 |
| 134 | | * @covers ::get_settings_errors() |
| | 134 | * @covers ::get_settings_errors |
| 135 | 135 | * @global array $wp_settings_errors |
| 136 | 136 | */ |
| 137 | 137 | public function test_get_settings_errors_sources() { |
| … |
… |
class Tests_Admin_includesTemplate extends WP_UnitTestCase { |
| 171 | 171 | |
| 172 | 172 | /** |
| 173 | 173 | * @ticket 44941 |
| 174 | | * @covers ::settings_errors() |
| | 174 | * @covers ::settings_errors |
| 175 | 175 | * @global array $wp_settings_errors |
| 176 | 176 | * @dataProvider settings_errors_css_classes_provider |
| 177 | 177 | */ |
-
diff --git a/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php b/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php
index b73701787c..e4823f21db 100644
|
a
|
b
|
class Tests_Admin_WpPrivacyRequestsTable extends WP_UnitTestCase { |
| 61 | 61 | * @param string $expected Expected in SQL query. |
| 62 | 62 | |
| 63 | 63 | * @dataProvider data_test_columns_should_be_sortable |
| 64 | | * @covers WP_Privacy_Requests_Table::prepare_items() |
| | 64 | * @covers WP_Privacy_Requests_Table::prepare_items |
| 65 | 65 | * @ticket 43960 |
| 66 | 66 | */ |
| 67 | 67 | public function test_columns_should_be_sortable( $order, $orderby, $search, $expected ) { |
-
diff --git a/tests/phpunit/tests/ajax/CustomizeManager.php b/tests/phpunit/tests/ajax/CustomizeManager.php
index 1126e8e667..e9a03de711 100644
|
a
|
b
|
class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase { |
| 103 | 103 | * Test WP_Customize_Manager::save(). |
| 104 | 104 | * |
| 105 | 105 | * @ticket 30937 |
| 106 | | * @covers WP_Customize_Manager::save() |
| | 106 | * @covers WP_Customize_Manager::save |
| 107 | 107 | */ |
| 108 | 108 | function test_save_failures() { |
| 109 | 109 | global $wp_customize; |
| … |
… |
class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase { |
| 270 | 270 | * Test WP_Customize_Manager::save(). |
| 271 | 271 | * |
| 272 | 272 | * @ticket 30937 |
| 273 | | * @covers WP_Customize_Manager::save() |
| | 273 | * @covers WP_Customize_Manager::save |
| 274 | 274 | */ |
| 275 | 275 | function test_save_success_publish_create() { |
| 276 | 276 | $wp_customize = $this->set_up_valid_state(); |
| … |
… |
class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase { |
| 299 | 299 | * Test WP_Customize_Manager::save(). |
| 300 | 300 | * |
| 301 | 301 | * @ticket 30937 |
| 302 | | * @covers WP_Customize_Manager::save() |
| | 302 | * @covers WP_Customize_Manager::save |
| 303 | 303 | */ |
| 304 | 304 | function test_save_success_publish_edit() { |
| 305 | 305 | $uuid = wp_generate_uuid4(); |
| … |
… |
class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase { |
| 338 | 338 | * Test WP_Customize_Manager::save(). |
| 339 | 339 | * |
| 340 | 340 | * @ticket 38943 |
| 341 | | * @covers WP_Customize_Manager::save() |
| | 341 | * @covers WP_Customize_Manager::save |
| 342 | 342 | */ |
| 343 | 343 | function test_success_save_post_date() { |
| 344 | 344 | $uuid = wp_generate_uuid4(); |
| … |
… |
class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase { |
| 436 | 436 | * Test WP_Customize_Manager::save(). |
| 437 | 437 | * |
| 438 | 438 | * @ticket 39896 |
| 439 | | * @covers WP_Customize_Manager::save() |
| | 439 | * @covers WP_Customize_Manager::save |
| 440 | 440 | */ |
| 441 | 441 | public function test_save_autosave() { |
| 442 | 442 | $uuid = wp_generate_uuid4(); |
| … |
… |
class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase { |
| 482 | 482 | * Test request for trashing a changeset. |
| 483 | 483 | * |
| 484 | 484 | * @ticket 39896 |
| 485 | | * @covers WP_Customize_Manager::handle_changeset_trash_request() |
| | 485 | * @covers WP_Customize_Manager::handle_changeset_trash_request |
| 486 | 486 | */ |
| 487 | 487 | public function test_handle_changeset_trash_request() { |
| 488 | 488 | $uuid = wp_generate_uuid4(); |
| … |
… |
class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase { |
| 570 | 570 | * Test request for dismissing autosave changesets. |
| 571 | 571 | * |
| 572 | 572 | * @ticket 39896 |
| 573 | | * @covers WP_Customize_Manager::handle_dismiss_autosave_or_lock_request() |
| 574 | | * @covers WP_Customize_Manager::dismiss_user_auto_draft_changesets() |
| | 573 | * @covers WP_Customize_Manager::handle_dismiss_autosave_or_lock_request |
| | 574 | * @covers WP_Customize_Manager::dismiss_user_auto_draft_changesets |
| 575 | 575 | */ |
| 576 | 576 | public function test_handle_dismiss_autosave_or_lock_request() { |
| 577 | 577 | $uuid = wp_generate_uuid4(); |
-
diff --git a/tests/phpunit/tests/ajax/CustomizeMenus.php b/tests/phpunit/tests/ajax/CustomizeMenus.php
index 6b16fea75f..09ca59fcc7 100644
|
a
|
b
|
class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { |
| 608 | 608 | /** |
| 609 | 609 | * Testing successful ajax_insert_auto_draft_post() call. |
| 610 | 610 | * |
| 611 | | * @covers WP_Customize_Nav_Menus::ajax_insert_auto_draft_post() |
| | 611 | * @covers WP_Customize_Nav_Menus::ajax_insert_auto_draft_post |
| 612 | 612 | */ |
| 613 | 613 | function test_ajax_insert_auto_draft_post_success() { |
| 614 | 614 | $_POST = wp_slash( |
| … |
… |
class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { |
| 638 | 638 | /** |
| 639 | 639 | * Testing unsuccessful ajax_insert_auto_draft_post() call. |
| 640 | 640 | * |
| 641 | | * @covers WP_Customize_Nav_Menus::ajax_insert_auto_draft_post() |
| | 641 | * @covers WP_Customize_Nav_Menus::ajax_insert_auto_draft_post |
| 642 | 642 | */ |
| 643 | 643 | function test_ajax_insert_auto_draft_failures() { |
| 644 | 644 | // No nonce. |
-
diff --git a/tests/phpunit/tests/customize/custom-css-setting.php b/tests/phpunit/tests/customize/custom-css-setting.php
index c8ade41de8..f7b68c7af9 100644
|
a
|
b
|
class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase { |
| 75 | 75 | * |
| 76 | 76 | * Also checks for the post type and the Setting Type. |
| 77 | 77 | * |
| 78 | | * @covers WP_Customize_Custom_CSS_Setting::__construct() |
| | 78 | * @covers WP_Customize_Custom_CSS_Setting::__construct |
| 79 | 79 | */ |
| 80 | 80 | function test_construct() { |
| 81 | 81 | $this->assertTrue( post_type_exists( 'custom_css' ) ); |
| … |
… |
class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase { |
| 106 | 106 | * Test crud methods on WP_Customize_Custom_CSS_Setting. |
| 107 | 107 | * |
| 108 | 108 | * @covers ::wp_get_custom_css |
| 109 | | * @covers WP_Customize_Custom_CSS_Setting::value() |
| 110 | | * @covers WP_Customize_Custom_CSS_Setting::preview() |
| 111 | | * @covers WP_Customize_Custom_CSS_Setting::update() |
| | 109 | * @covers WP_Customize_Custom_CSS_Setting::value |
| | 110 | * @covers WP_Customize_Custom_CSS_Setting::preview |
| | 111 | * @covers WP_Customize_Custom_CSS_Setting::update |
| 112 | 112 | */ |
| 113 | 113 | function test_crud() { |
| 114 | 114 | |
| … |
… |
class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase { |
| 266 | 266 | /** |
| 267 | 267 | * Test crud methods on WP_Customize_Custom_CSS_Setting. |
| 268 | 268 | * |
| 269 | | * @covers WP_Customize_Custom_CSS_Setting::value() |
| | 269 | * @covers WP_Customize_Custom_CSS_Setting::value |
| 270 | 270 | */ |
| 271 | 271 | function test_value_filter() { |
| 272 | 272 | add_filter( 'customize_value_custom_css', array( $this, 'filter_value' ), 10, 2 ); |
| … |
… |
class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase { |
| 306 | 306 | /** |
| 307 | 307 | * Test update filter on WP_Customize_Custom_CSS_Setting. |
| 308 | 308 | * |
| 309 | | * @covers WP_Customize_Custom_CSS_Setting::update() |
| | 309 | * @covers WP_Customize_Custom_CSS_Setting::update |
| 310 | 310 | */ |
| 311 | 311 | function test_update_filter() { |
| 312 | 312 | $original_css = 'body { color:red; }'; |
| … |
… |
class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase { |
| 364 | 364 | * Note that the $validity \WP_Error object must be reset each time |
| 365 | 365 | * as it picks up the Errors and passes them to the next assertion. |
| 366 | 366 | * |
| 367 | | * @covers WP_Customize_Custom_CSS_Setting::validate() |
| | 367 | * @covers WP_Customize_Custom_CSS_Setting::validate |
| 368 | 368 | */ |
| 369 | 369 | function test_validate() { |
| 370 | 370 | |
-
diff --git a/tests/phpunit/tests/customize/manager.php b/tests/phpunit/tests/customize/manager.php
index 4a9d5caead..f965eddd4e 100644
|
a
|
b
|
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 106 | 106 | /** |
| 107 | 107 | * Test WP_Customize_Manager::__construct(). |
| 108 | 108 | * |
| 109 | | * @covers WP_Customize_Manager::__construct() |
| | 109 | * @covers WP_Customize_Manager::__construct |
| 110 | 110 | */ |
| 111 | 111 | function test_constructor() { |
| 112 | 112 | $uuid = wp_generate_uuid4(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 151 | 151 | * Test constructor when deferring UUID. |
| 152 | 152 | * |
| 153 | 153 | * @ticket 39896 |
| 154 | | * @covers WP_Customize_Manager::establish_loaded_changeset() |
| 155 | | * @covers WP_Customize_Manager::__construct() |
| | 154 | * @covers WP_Customize_Manager::establish_loaded_changeset |
| | 155 | * @covers WP_Customize_Manager::__construct |
| 156 | 156 | */ |
| 157 | 157 | public function test_constructor_deferred_changeset_uuid() { |
| 158 | 158 | wp_set_current_user( self::$admin_user_id ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 225 | 225 | /** |
| 226 | 226 | * Test WP_Customize_Manager::setup_theme() for admin screen. |
| 227 | 227 | * |
| 228 | | * @covers WP_Customize_Manager::setup_theme() |
| | 228 | * @covers WP_Customize_Manager::setup_theme |
| 229 | 229 | */ |
| 230 | 230 | function test_setup_theme_in_customize_admin() { |
| 231 | 231 | global $pagenow, $wp_customize; |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 294 | 294 | /** |
| 295 | 295 | * Test WP_Customize_Manager::setup_theme() for frontend. |
| 296 | 296 | * |
| 297 | | * @covers WP_Customize_Manager::setup_theme() |
| | 297 | * @covers WP_Customize_Manager::setup_theme |
| 298 | 298 | */ |
| 299 | 299 | function test_setup_theme_in_frontend() { |
| 300 | 300 | global $wp_customize, $pagenow, $show_admin_bar; |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 329 | 329 | * Test WP_Customize_Manager::settings_previewed(). |
| 330 | 330 | * |
| 331 | 331 | * @ticket 39221 |
| 332 | | * @covers WP_Customize_Manager::settings_previewed() |
| | 332 | * @covers WP_Customize_Manager::settings_previewed |
| 333 | 333 | */ |
| 334 | 334 | function test_settings_previewed() { |
| 335 | 335 | $wp_customize = new WP_Customize_Manager( array( 'settings_previewed' => false ) ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 343 | 343 | * Test WP_Customize_Manager::autosaved(). |
| 344 | 344 | * |
| 345 | 345 | * @ticket 39896 |
| 346 | | * @covers WP_Customize_Manager::autosaved() |
| | 346 | * @covers WP_Customize_Manager::autosaved |
| 347 | 347 | */ |
| 348 | 348 | public function test_autosaved() { |
| 349 | 349 | $wp_customize = new WP_Customize_Manager(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 360 | 360 | * Test WP_Customize_Manager::branching(). |
| 361 | 361 | * |
| 362 | 362 | * @ticket 39896 |
| 363 | | * @covers WP_Customize_Manager::branching() |
| | 363 | * @covers WP_Customize_Manager::branching |
| 364 | 364 | */ |
| 365 | 365 | public function test_branching() { |
| 366 | 366 | $wp_customize = new WP_Customize_Manager(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 382 | 382 | * Test WP_Customize_Manager::changeset_uuid(). |
| 383 | 383 | * |
| 384 | 384 | * @ticket 30937 |
| 385 | | * @covers WP_Customize_Manager::changeset_uuid() |
| | 385 | * @covers WP_Customize_Manager::changeset_uuid |
| 386 | 386 | */ |
| 387 | 387 | function test_changeset_uuid() { |
| 388 | 388 | $uuid = wp_generate_uuid4(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 396 | 396 | * Ensure that post values are previewed even without being in preview. |
| 397 | 397 | * |
| 398 | 398 | * @ticket 30937 |
| 399 | | * @covers WP_Customize_Manager::wp_loaded() |
| | 399 | * @covers WP_Customize_Manager::wp_loaded |
| 400 | 400 | */ |
| 401 | 401 | function test_wp_loaded() { |
| 402 | 402 | wp_set_current_user( self::$admin_user_id ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 414 | 414 | * Test WP_Customize_Manager::find_changeset_post_id(). |
| 415 | 415 | * |
| 416 | 416 | * @ticket 30937 |
| 417 | | * @covers WP_Customize_Manager::find_changeset_post_id() |
| | 417 | * @covers WP_Customize_Manager::find_changeset_post_id |
| 418 | 418 | */ |
| 419 | 419 | function test_find_changeset_post_id() { |
| 420 | 420 | $uuid = wp_generate_uuid4(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 439 | 439 | * Test WP_Customize_Manager::changeset_post_id(). |
| 440 | 440 | * |
| 441 | 441 | * @ticket 30937 |
| 442 | | * @covers WP_Customize_Manager::changeset_post_id() |
| | 442 | * @covers WP_Customize_Manager::changeset_post_id |
| 443 | 443 | */ |
| 444 | 444 | function test_changeset_post_id() { |
| 445 | 445 | $uuid = wp_generate_uuid4(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 463 | 463 | * Test WP_Customize_Manager::changeset_data(). |
| 464 | 464 | * |
| 465 | 465 | * @ticket 30937 |
| 466 | | * @covers WP_Customize_Manager::changeset_data() |
| | 466 | * @covers WP_Customize_Manager::changeset_data |
| 467 | 467 | */ |
| 468 | 468 | function test_changeset_data() { |
| 469 | 469 | wp_set_current_user( self::$admin_user_id ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 539 | 539 | /** |
| 540 | 540 | * Test WP_Customize_Manager::import_theme_starter_content(). |
| 541 | 541 | * |
| 542 | | * @covers WP_Customize_Manager::import_theme_starter_content() |
| 543 | | * @covers WP_Customize_Manager::_save_starter_content_changeset() |
| | 542 | * @covers WP_Customize_Manager::import_theme_starter_content |
| | 543 | * @covers WP_Customize_Manager::_save_starter_content_changeset |
| 544 | 544 | */ |
| 545 | 545 | function test_import_theme_starter_content() { |
| 546 | 546 | wp_set_current_user( self::$admin_user_id ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 808 | 808 | * Test WP_Customize_Manager::import_theme_starter_content() with nested arrays. |
| 809 | 809 | * |
| 810 | 810 | * @ticket 45484 |
| 811 | | * @covers WP_Customize_Manager::import_theme_starter_content() |
| | 811 | * @covers WP_Customize_Manager::import_theme_starter_content |
| 812 | 812 | */ |
| 813 | 813 | function test_import_theme_starter_content_with_nested_arrays() { |
| 814 | 814 | wp_set_current_user( self::$admin_user_id ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 882 | 882 | * Test WP_Customize_Manager::customize_preview_init(). |
| 883 | 883 | * |
| 884 | 884 | * @ticket 30937 |
| 885 | | * @covers WP_Customize_Manager::customize_preview_init() |
| | 885 | * @covers WP_Customize_Manager::customize_preview_init |
| 886 | 886 | */ |
| 887 | 887 | function test_customize_preview_init() { |
| 888 | 888 | |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 927 | 927 | * |
| 928 | 928 | * @ticket 30937 |
| 929 | 929 | * @ticket 40020 |
| 930 | | * @covers WP_Customize_Manager::filter_iframe_security_headers() |
| | 930 | * @covers WP_Customize_Manager::filter_iframe_security_headers |
| 931 | 931 | */ |
| 932 | 932 | function test_filter_iframe_security_headers() { |
| 933 | 933 | $wp_customize = new WP_Customize_Manager(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 942 | 942 | * Test WP_Customize_Manager::add_state_query_params(). |
| 943 | 943 | * |
| 944 | 944 | * @ticket 30937 |
| 945 | | * @covers WP_Customize_Manager::add_state_query_params() |
| | 945 | * @covers WP_Customize_Manager::add_state_query_params |
| 946 | 946 | */ |
| 947 | 947 | function test_add_state_query_params() { |
| 948 | 948 | $preview_theme = $this->get_inactive_core_theme(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 1001 | 1001 | * Test WP_Customize_Manager::save_changeset_post(). |
| 1002 | 1002 | * |
| 1003 | 1003 | * @ticket 30937 |
| 1004 | | * @covers WP_Customize_Manager::save_changeset_post() |
| | 1004 | * @covers WP_Customize_Manager::save_changeset_post |
| 1005 | 1005 | */ |
| 1006 | 1006 | function test_save_changeset_post_without_theme_activation() { |
| 1007 | 1007 | global $wp_customize; |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 1243 | 1243 | /** |
| 1244 | 1244 | * Test saving changeset post without Kses or other content_save_pre filters mutating content. |
| 1245 | 1245 | * |
| 1246 | | * @covers WP_Customize_Manager::save_changeset_post() |
| | 1246 | * @covers WP_Customize_Manager::save_changeset_post |
| 1247 | 1247 | */ |
| 1248 | 1248 | public function test_save_changeset_post_without_kses_corrupting_json() { |
| 1249 | 1249 | global $wp_customize; |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 1446 | 1446 | * Test WP_Customize_Manager::save_changeset_post(). |
| 1447 | 1447 | * |
| 1448 | 1448 | * @ticket 30937 |
| 1449 | | * @covers WP_Customize_Manager::save_changeset_post() |
| 1450 | | * @covers WP_Customize_Manager::update_stashed_theme_mod_settings() |
| | 1449 | * @covers WP_Customize_Manager::save_changeset_post |
| | 1450 | * @covers WP_Customize_Manager::update_stashed_theme_mod_settings |
| 1451 | 1451 | */ |
| 1452 | 1452 | function test_save_changeset_post_with_theme_activation() { |
| 1453 | 1453 | global $wp_customize; |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 1485 | 1485 | * Test saving changesets with varying users and capabilities. |
| 1486 | 1486 | * |
| 1487 | 1487 | * @ticket 38705 |
| 1488 | | * @covers WP_Customize_Manager::save_changeset_post() |
| | 1488 | * @covers WP_Customize_Manager::save_changeset_post |
| 1489 | 1489 | */ |
| 1490 | 1490 | function test_save_changeset_post_with_varying_users() { |
| 1491 | 1491 | global $wp_customize; |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 1660 | 1660 | * |
| 1661 | 1661 | * @ticket 31089 |
| 1662 | 1662 | * @see wp_delete_auto_drafts() |
| 1663 | | * @covers WP_Customize_Manager::save_changeset_post() |
| | 1663 | * @covers WP_Customize_Manager::save_changeset_post |
| 1664 | 1664 | */ |
| 1665 | 1665 | function test_save_changeset_post_dumping_auto_draft_date() { |
| 1666 | 1666 | global $wp_customize; |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 1700 | 1700 | * Test writing changesets when user supplies unchanged values. |
| 1701 | 1701 | * |
| 1702 | 1702 | * @ticket 38865 |
| 1703 | | * @covers WP_Customize_Manager::save_changeset_post() |
| | 1703 | * @covers WP_Customize_Manager::save_changeset_post |
| 1704 | 1704 | */ |
| 1705 | 1705 | function test_save_changeset_post_with_unchanged_values() { |
| 1706 | 1706 | global $wp_customize; |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 1790 | 1790 | * Test writing changesets when user supplies unchanged values. |
| 1791 | 1791 | * |
| 1792 | 1792 | * @ticket 39896 |
| 1793 | | * @covers WP_Customize_Manager::save_changeset_post() |
| 1794 | | * @covers WP_Customize_Manager::grant_edit_post_capability_for_changeset() |
| | 1793 | * @covers WP_Customize_Manager::save_changeset_post |
| | 1794 | * @covers WP_Customize_Manager::grant_edit_post_capability_for_changeset |
| 1795 | 1795 | */ |
| 1796 | 1796 | public function test_save_changeset_post_with_autosave() { |
| 1797 | 1797 | wp_set_current_user( self::$admin_user_id ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 1900 | 1900 | * Test passing `null` for a setting ID to remove it from the changeset. |
| 1901 | 1901 | * |
| 1902 | 1902 | * @ticket 41621 |
| 1903 | | * @covers WP_Customize_Manager::save_changeset_post() |
| | 1903 | * @covers WP_Customize_Manager::save_changeset_post |
| 1904 | 1904 | */ |
| 1905 | 1905 | function test_remove_setting_from_changeset_post() { |
| 1906 | 1906 | $uuid = wp_generate_uuid4(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 1936 | 1936 | * Test writing changesets and publishing with users who can unfiltered_html and those who cannot. |
| 1937 | 1937 | * |
| 1938 | 1938 | * @ticket 38705 |
| 1939 | | * @covers WP_Customize_Manager::save_changeset_post() |
| | 1939 | * @covers WP_Customize_Manager::save_changeset_post |
| 1940 | 1940 | */ |
| 1941 | 1941 | function test_save_changeset_post_with_varying_unfiltered_html_cap() { |
| 1942 | 1942 | global $wp_customize; |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 2006 | 2006 | * publishing |
| 2007 | 2007 | * |
| 2008 | 2008 | * @ticket 39221 |
| 2009 | | * @covers ::_wp_customize_publish_changeset() |
| | 2009 | * @covers ::_wp_customize_publish_changeset |
| 2010 | 2010 | * @see WP_Customize_Widgets::schedule_customize_register() |
| 2011 | 2011 | * @see WP_Customize_Widgets::customize_register() |
| 2012 | 2012 | */ |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 2192 | 2192 | * Test WP_Customize_Manager::is_cross_domain(). |
| 2193 | 2193 | * |
| 2194 | 2194 | * @ticket 30937 |
| 2195 | | * @covers WP_Customize_Manager::is_cross_domain() |
| | 2195 | * @covers WP_Customize_Manager::is_cross_domain |
| 2196 | 2196 | */ |
| 2197 | 2197 | function test_is_cross_domain() { |
| 2198 | 2198 | $wp_customize = new WP_Customize_Manager(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 2210 | 2210 | * Test WP_Customize_Manager::get_allowed_urls(). |
| 2211 | 2211 | * |
| 2212 | 2212 | * @ticket 30937 |
| 2213 | | * @covers WP_Customize_Manager::get_allowed_urls() |
| | 2213 | * @covers WP_Customize_Manager::get_allowed_urls |
| 2214 | 2214 | */ |
| 2215 | 2215 | function test_get_allowed_urls() { |
| 2216 | 2216 | $wp_customize = new WP_Customize_Manager(); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 2293 | 2293 | * Test WP_Customize_Manager::unsanitized_post_values(). |
| 2294 | 2294 | * |
| 2295 | 2295 | * @ticket 30937 |
| 2296 | | * @covers WP_Customize_Manager::unsanitized_post_values() |
| | 2296 | * @covers WP_Customize_Manager::unsanitized_post_values |
| 2297 | 2297 | */ |
| 2298 | 2298 | function test_unsanitized_post_values_with_changeset_and_stashed_theme_mods() { |
| 2299 | 2299 | wp_set_current_user( self::$admin_user_id ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 2607 | 2607 | * Test WP_Customize_Manager::validate_setting_values(). |
| 2608 | 2608 | * |
| 2609 | 2609 | * @ticket 37638 |
| 2610 | | * @covers WP_Customize_Manager::validate_setting_values() |
| | 2610 | * @covers WP_Customize_Manager::validate_setting_values |
| 2611 | 2611 | */ |
| 2612 | 2612 | function test_late_validate_setting_values() { |
| 2613 | 2613 | $setting = new Test_Setting_Without_Applying_Validate_Filter( $this->manager, 'required' ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 2633 | 2633 | * Test WP_Customize_Manager::validate_setting_values(). |
| 2634 | 2634 | * |
| 2635 | 2635 | * @ticket 30937 |
| 2636 | | * @covers WP_Customize_Manager::validate_setting_values() |
| | 2636 | * @covers WP_Customize_Manager::validate_setting_values |
| 2637 | 2637 | */ |
| 2638 | 2638 | function test_validate_setting_values_args() { |
| 2639 | 2639 | wp_set_current_user( self::$admin_user_id ); |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 2814 | 2814 | * Test WP_Customize_Manager::has_published_pages(). |
| 2815 | 2815 | * |
| 2816 | 2816 | * @ticket 38013 |
| 2817 | | * @covers WP_Customize_Manager::has_published_pages() |
| | 2817 | * @covers WP_Customize_Manager::has_published_pages |
| 2818 | 2818 | */ |
| 2819 | 2819 | function test_has_published_pages() { |
| 2820 | 2820 | foreach ( get_pages() as $page ) { |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 2843 | 2843 | * Ensure that page stubs created via nav menus will cause has_published_pages to return true. |
| 2844 | 2844 | * |
| 2845 | 2845 | * @ticket 38013 |
| 2846 | | * @covers WP_Customize_Manager::has_published_pages() |
| | 2846 | * @covers WP_Customize_Manager::has_published_pages |
| 2847 | 2847 | */ |
| 2848 | 2848 | function test_has_published_pages_when_nav_menus_created_posts() { |
| 2849 | 2849 | foreach ( get_pages() as $page ) { |
| … |
… |
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
| 3115 | 3115 | * Test remove_frameless_preview_messenger_channel. |
| 3116 | 3116 | * |
| 3117 | 3117 | * @ticket 38867 |
| 3118 | | * @covers WP_Customize_Manager::remove_frameless_preview_messenger_channel() |
| | 3118 | * @covers WP_Customize_Manager::remove_frameless_preview_messenger_channel |
| 3119 | 3119 | */ |
| 3120 | 3120 | function test_remove_frameless_preview_messenger_channel() { |
| 3121 | 3121 | wp_set_current_user( self::$admin_user_id ); |
-
diff --git a/tests/phpunit/tests/customize/nav-menu-item-setting.php b/tests/phpunit/tests/customize/nav-menu-item-setting.php
index c80ce613b4..f39eba07af 100644
|
a
|
b
|
class Test_WP_Customize_Nav_Menu_Item_Setting extends WP_UnitTestCase { |
| 944 | 944 | * Test WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item() to set url for posts, terms, and post type archives. |
| 945 | 945 | * |
| 946 | 946 | * @ticket 38945 |
| 947 | | * @covers WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item() |
| | 947 | * @covers WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item |
| 948 | 948 | */ |
| 949 | 949 | function test_value_as_wp_post_nav_menu_item_term_urls() { |
| 950 | 950 | $term_id = self::factory()->term->create( array( 'taxonomy' => 'category' ) ); |
| … |
… |
class Test_WP_Customize_Nav_Menu_Item_Setting extends WP_UnitTestCase { |
| 1017 | 1017 | * Test WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item() for obtaining original title. |
| 1018 | 1018 | * |
| 1019 | 1019 | * @ticket 38945 |
| 1020 | | * @covers WP_Customize_Nav_Menu_Item_Setting::get_original_title() |
| | 1020 | * @covers WP_Customize_Nav_Menu_Item_Setting::get_original_title |
| 1021 | 1021 | */ |
| 1022 | 1022 | function test_get_original_title() { |
| 1023 | 1023 | $menu_id = wp_create_nav_menu( 'Menu' ); |
-
diff --git a/tests/phpunit/tests/customize/nav-menus.php b/tests/phpunit/tests/customize/nav-menus.php
index bb82db7e48..4b9b8ca925 100644
|
a
|
b
|
class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase { |
| 661 | 661 | /** |
| 662 | 662 | * Test insert_auto_draft_post method. |
| 663 | 663 | * |
| 664 | | * @covers WP_Customize_Nav_Menus::insert_auto_draft_post() |
| | 664 | * @covers WP_Customize_Nav_Menus::insert_auto_draft_post |
| 665 | 665 | */ |
| 666 | 666 | public function test_insert_auto_draft_post() { |
| 667 | 667 | $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); |
| … |
… |
class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase { |
| 835 | 835 | /** |
| 836 | 836 | * Test make_auto_draft_status_previewable. |
| 837 | 837 | * |
| 838 | | * @covers WP_Customize_Nav_Menus::make_auto_draft_status_previewable() |
| | 838 | * @covers WP_Customize_Nav_Menus::make_auto_draft_status_previewable |
| 839 | 839 | */ |
| 840 | 840 | function test_make_auto_draft_status_previewable() { |
| 841 | 841 | global $wp_post_statuses; |
| … |
… |
class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase { |
| 847 | 847 | /** |
| 848 | 848 | * Test sanitize_nav_menus_created_posts. |
| 849 | 849 | * |
| 850 | | * @covers WP_Customize_Nav_Menus::sanitize_nav_menus_created_posts() |
| | 850 | * @covers WP_Customize_Nav_Menus::sanitize_nav_menus_created_posts |
| 851 | 851 | */ |
| 852 | 852 | function test_sanitize_nav_menus_created_posts() { |
| 853 | 853 | $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); |
| … |
… |
class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase { |
| 921 | 921 | /** |
| 922 | 922 | * Test save_nav_menus_created_posts. |
| 923 | 923 | * |
| 924 | | * @covers WP_Customize_Nav_Menus::save_nav_menus_created_posts() |
| | 924 | * @covers WP_Customize_Nav_Menus::save_nav_menus_created_posts |
| 925 | 925 | */ |
| 926 | 926 | function test_save_nav_menus_created_posts() { |
| 927 | 927 | $menus = new WP_Customize_Nav_Menus( $this->wp_customize ); |
| … |
… |
class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase { |
| 1114 | 1114 | /** |
| 1115 | 1115 | * Test the filter_wp_nav_menu method. |
| 1116 | 1116 | * |
| 1117 | | * @covers WP_Customize_Nav_Menus::filter_wp_nav_menu() |
| 1118 | | * @covers WP_Customize_Nav_Menus::filter_wp_nav_menu_args() |
| | 1117 | * @covers WP_Customize_Nav_Menus::filter_wp_nav_menu |
| | 1118 | * @covers WP_Customize_Nav_Menus::filter_wp_nav_menu_args |
| 1119 | 1119 | */ |
| 1120 | 1120 | function test_filter_wp_nav_menu() { |
| 1121 | 1121 | do_action( 'customize_register', $this->wp_customize ); |
-
diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php
index 20489390d6..a3f9c1e163 100644
|
a
|
b
|
JS; |
| 1045 | 1045 | * Testing `wp_enqueue_code_editor` with file path. |
| 1046 | 1046 | * |
| 1047 | 1047 | * @ticket 41871 |
| 1048 | | * @covers ::wp_enqueue_code_editor() |
| | 1048 | * @covers ::wp_enqueue_code_editor |
| 1049 | 1049 | */ |
| 1050 | 1050 | public function test_wp_enqueue_code_editor_when_php_file_will_be_passed() { |
| 1051 | 1051 | $real_file = WP_PLUGIN_DIR . '/hello.php'; |
| … |
… |
JS; |
| 1132 | 1132 | * Testing `wp_enqueue_code_editor` with `compact`. |
| 1133 | 1133 | * |
| 1134 | 1134 | * @ticket 41871 |
| 1135 | | * @covers ::wp_enqueue_code_editor() |
| | 1135 | * @covers ::wp_enqueue_code_editor |
| 1136 | 1136 | */ |
| 1137 | 1137 | public function test_wp_enqueue_code_editor_when_generated_array_by_compact_will_be_passed() { |
| 1138 | 1138 | $file = ''; |
| … |
… |
JS; |
| 1215 | 1215 | * Testing `wp_enqueue_code_editor` with `array_merge`. |
| 1216 | 1216 | * |
| 1217 | 1217 | * @ticket 41871 |
| 1218 | | * @covers ::wp_enqueue_code_editor() |
| | 1218 | * @covers ::wp_enqueue_code_editor |
| 1219 | 1219 | */ |
| 1220 | 1220 | public function test_wp_enqueue_code_editor_when_generated_array_by_array_merge_will_be_passed() { |
| 1221 | 1221 | $wp_enqueue_code_editor = wp_enqueue_code_editor( |
| … |
… |
JS; |
| 1312 | 1312 | * Testing `wp_enqueue_code_editor` with `array`. |
| 1313 | 1313 | * |
| 1314 | 1314 | * @ticket 41871 |
| 1315 | | * @covers ::wp_enqueue_code_editor() |
| | 1315 | * @covers ::wp_enqueue_code_editor |
| 1316 | 1316 | */ |
| 1317 | 1317 | public function test_wp_enqueue_code_editor_when_simple_array_will_be_passed() { |
| 1318 | 1318 | $wp_enqueue_code_editor = wp_enqueue_code_editor( |
-
diff --git a/tests/phpunit/tests/general/wpError.php b/tests/phpunit/tests/general/wpError.php
index 3fccc470c8..72a575fbf7 100644
|
a
|
b
|
class Tests_WP_Error extends WP_UnitTestCase { |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | | * @covers ::get_error_codes() |
| | 103 | * @covers ::get_error_codes |
| 104 | 104 | */ |
| 105 | 105 | public function test_get_error_codes_with_no_errors_should_return_empty_array() { |
| 106 | 106 | $this->assertEmpty( $this->wp_error->get_error_codes() ); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | | * @covers ::get_error_codes() |
| | 110 | * @covers ::get_error_codes |
| 111 | 111 | */ |
| 112 | 112 | public function test_get_error_codes_with_one_error_should_return_an_array_with_only_that_code() { |
| 113 | 113 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | | * @covers ::get_error_codes() |
| | 119 | * @covers ::get_error_codes |
| 120 | 120 | */ |
| 121 | 121 | public function test_get_error_codes_with_multiple_errors_should_return_an_array_of_those_codes() { |
| 122 | 122 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | | * @covers ::get_error_code() |
| | 131 | * @covers ::get_error_code |
| 132 | 132 | */ |
| 133 | 133 | public function test_get_error_code_with_no_errors_should_return_an_empty_string() { |
| 134 | 134 | $this->assertSame( '', $this->wp_error->get_error_code() ); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
| 138 | | * @covers ::get_error_code() |
| | 138 | * @covers ::get_error_code |
| 139 | 139 | */ |
| 140 | 140 | public function test_get_error_code_with_one_error_should_return_that_error_code() { |
| 141 | 141 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | | * @covers ::get_error_code() |
| | 147 | * @covers ::get_error_code |
| 148 | 148 | */ |
| 149 | 149 | public function test_get_error_code_with_multiple_errors_should_return_only_the_first_error_code() { |
| 150 | 150 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | | * @covers ::get_error_messages() |
| | 157 | * @covers ::get_error_messages |
| 158 | 158 | */ |
| 159 | 159 | public function test_get_error_messages_with_empty_code_and_no_errors_should_return_an_empty_array() { |
| 160 | 160 | $this->assertEmpty( $this->wp_error->get_error_messages() ); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | | * @covers ::get_error_messages() |
| | 164 | * @covers ::get_error_messages |
| 165 | 165 | */ |
| 166 | 166 | public function test_get_error_messages_with_empty_code_one_error_should_return_an_array_with_that_message() { |
| 167 | 167 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
| 173 | | * @covers ::get_error_messages() |
| | 173 | * @covers ::get_error_messages |
| 174 | 174 | */ |
| 175 | 175 | public function test_get_error_messages_with_empty_code_multiple_errors_should_return_an_array_of_messages() { |
| 176 | 176 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
| 183 | | * @covers ::get_error_messages() |
| | 183 | * @covers ::get_error_messages |
| 184 | 184 | */ |
| 185 | 185 | public function test_get_error_messages_with_an_invalid_code_should_return_an_empty_array() { |
| 186 | 186 | $this->assertEmpty( $this->wp_error->get_error_messages( 'code' ) ); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | | * @covers ::get_error_messages() |
| | 190 | * @covers ::get_error_messages |
| 191 | 191 | */ |
| 192 | 192 | public function test_get_error_messages_with_one_error_should_return_an_array_with_that_message() { |
| 193 | 193 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | | * @covers ::get_error_messages() |
| | 199 | * @covers ::get_error_messages |
| 200 | 200 | */ |
| 201 | 201 | public function test_get_error_messages_with_multiple_errors_same_code_should_return_an_array_with_all_messages() { |
| 202 | 202 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
| 209 | | * @covers ::get_error_message() |
| | 209 | * @covers ::get_error_message |
| 210 | 210 | */ |
| 211 | 211 | public function test_get_error_message_with_empty_code_and_no_errors_should_return_an_empty_string() { |
| 212 | 212 | $this->assertSame( '', $this->wp_error->get_error_message() ); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | | * @covers ::get_error_message() |
| | 216 | * @covers ::get_error_message |
| 217 | 217 | */ |
| 218 | 218 | public function test_get_error_message_with_empty_code_and_one_error_should_return_that_message() { |
| 219 | 219 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
| 225 | | * @covers ::get_error_message() |
| | 225 | * @covers ::get_error_message |
| 226 | 226 | */ |
| 227 | 227 | public function test_get_error_message_with_empty_code_and_multiple_errors_should_return_the_first_message() { |
| 228 | 228 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** |
| 235 | | * @covers ::get_error_message() |
| | 235 | * @covers ::get_error_message |
| 236 | 236 | */ |
| 237 | 237 | public function test_get_error_message_with_empty_code_and_multiple_errors_multiple_codes_should_return_the_first_message() { |
| 238 | 238 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
| 246 | | * @covers ::get_error_message() |
| | 246 | * @covers ::get_error_message |
| 247 | 247 | */ |
| 248 | 248 | public function test_get_error_message_with_invalid_code_and_no_errors_should_return_empty_string() { |
| 249 | 249 | $this->assertSame( '', $this->wp_error->get_error_message( 'invalid' ) ); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** |
| 253 | | * @covers ::get_error_message() |
| | 253 | * @covers ::get_error_message |
| 254 | 254 | */ |
| 255 | 255 | public function test_get_error_message_with_invalid_code_and_one_error_should_return_an_empty_string() { |
| 256 | 256 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /** |
| 262 | | * @covers ::get_error_message() |
| | 262 | * @covers ::get_error_message |
| 263 | 263 | */ |
| 264 | 264 | public function test_get_error_message_with_invalid_code_and_multiple_errors_should_return_an_empty_string() { |
| 265 | 265 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | /** |
| 272 | | * @covers ::get_error_data() |
| | 272 | * @covers ::get_error_data |
| 273 | 273 | */ |
| 274 | 274 | public function test_get_error_data_with_empty_code_and_no_errors_should_evaluate_as_null() { |
| 275 | 275 | $this->assertSame( null, $this->wp_error->get_error_data() ); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /** |
| 279 | | * @covers ::get_error_data() |
| | 279 | * @covers ::get_error_data |
| 280 | 280 | */ |
| 281 | 281 | public function test_get_error_data_with_empty_code_one_error_no_data_should_evaluate_as_null() { |
| 282 | 282 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | /** |
| 288 | | * @covers ::get_error_data() |
| | 288 | * @covers ::get_error_data |
| 289 | 289 | */ |
| 290 | 290 | public function test_get_error_data_with_empty_code_multiple_errors_no_data_should_evaluate_as_null() { |
| 291 | 291 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
| 298 | | * @covers ::get_error_data() |
| | 298 | * @covers ::get_error_data |
| 299 | 299 | */ |
| 300 | 300 | public function test_get_error_data_with_empty_code_and_one_error_with_data_should_return_that_data() { |
| 301 | 301 | $expected = array( 'data-key' => 'data-value' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | /** |
| 308 | | * @covers ::get_error_data() |
| | 308 | * @covers ::get_error_data |
| 309 | 309 | */ |
| 310 | 310 | public function test_get_error_data_with_empty_code_and_multiple_errors_different_codes_should_return_the_last_data_of_the_first_code() { |
| 311 | 311 | $expected = array( 'data-key' => 'data-value' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | /** |
| 319 | | * @covers ::get_error_data() |
| | 319 | * @covers ::get_error_data |
| 320 | 320 | */ |
| 321 | 321 | public function test_get_error_data_with_empty_code_and_multiple_errors_same_code_should_return_the_last_data_of_the_first_code() { |
| 322 | 322 | $this->wp_error->add( 'code', 'message', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | /** |
| 330 | | * @covers ::get_error_data() |
| | 330 | * @covers ::get_error_data |
| 331 | 331 | */ |
| 332 | 332 | public function test_get_error_data_with_code_and_no_errors_should_evaluate_as_null() { |
| 333 | 333 | $this->assertSame( null, $this->wp_error->get_error_data( 'code' ) ); |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | /** |
| 337 | | * @covers ::get_error_data() |
| | 337 | * @covers ::get_error_data |
| 338 | 338 | */ |
| 339 | 339 | public function test_get_error_data_with_code_and_one_error_with_no_data_should_evaluate_as_null() { |
| 340 | 340 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | /** |
| 346 | | * @covers ::get_error_data() |
| | 346 | * @covers ::get_error_data |
| 347 | 347 | */ |
| 348 | 348 | public function test_get_error_data_with_code_and_one_error_with_data_should_return_that_data() { |
| 349 | 349 | $expected = array( 'data-key' => 'data-value' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | /** |
| 356 | | * @covers ::get_error_data() |
| | 356 | * @covers ::get_error_data |
| 357 | 357 | */ |
| 358 | 358 | public function test_get_error_data_with_code_and_multiple_errors_different_codes_should_return_the_last_stored_data_of_the_code() { |
| 359 | 359 | $expected = array( 'data3' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | /** |
| 368 | | * @covers ::get_error_data() |
| | 368 | * @covers ::get_error_data |
| 369 | 369 | */ |
| 370 | 370 | public function test_get_error_data_with_code_and_multiple_errors_same_code_should_return_the_last_stored_data() { |
| 371 | 371 | $this->wp_error->add( 'code', 'message', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | /** |
| 379 | | * @covers ::has_errors() |
| | 379 | * @covers ::has_errors |
| 380 | 380 | */ |
| 381 | 381 | public function test_has_errors_with_no_errors_returns_false() { |
| 382 | 382 | $this->assertFalse( $this->wp_error->has_errors() ); |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /** |
| 386 | | * @covers ::has_errors() |
| | 386 | * @covers ::has_errors |
| 387 | 387 | */ |
| 388 | 388 | public function test_has_errors_with_errors_returns_true() { |
| 389 | 389 | $this->wp_error->add( 'code', 'message', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | /** |
| 394 | | * @covers ::add() |
| | 394 | * @covers ::add |
| 395 | 395 | */ |
| 396 | 396 | public function test_add_with_empty_code_empty_message_empty_data_should_add_empty_key_to_errors_array() { |
| 397 | 397 | $this->wp_error->add( '', '', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | /** |
| 403 | | * @covers ::add() |
| | 403 | * @covers ::add |
| 404 | 404 | */ |
| 405 | 405 | public function test_add_with_empty_code_empty_message_empty_data_should_add_empty_message_to_errors_array_under_empty_key() { |
| 406 | 406 | $this->wp_error->add( '', '', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | /** |
| 412 | | * @covers ::add() |
| | 412 | * @covers ::add |
| 413 | 413 | */ |
| 414 | 414 | public function test_add_with_empty_code_empty_message_empty_data_should_not_alter_data() { |
| 415 | 415 | $this->wp_error->add( '', '', '' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /** |
| 421 | | * @covers ::add() |
| | 421 | * @covers ::add |
| 422 | 422 | */ |
| 423 | 423 | public function test_add_with_empty_code_empty_message_non_empty_data_should_store_data_under_an_empty_code_key() { |
| 424 | 424 | $this->wp_error->add( '', '', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | /** |
| 430 | | * @covers ::add() |
| | 430 | * @covers ::add |
| 431 | 431 | */ |
| 432 | 432 | public function test_add_with_code_empty_message_empty_data_should_add_error_with_code() { |
| 433 | 433 | $this->wp_error->add( 'code', '' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | /** |
| 439 | | * @covers ::add() |
| | 439 | * @covers ::add |
| 440 | 440 | */ |
| 441 | 441 | public function test_add_with_code_empty_message_empty_data_should_add_error_with_empty_message() { |
| 442 | 442 | $this->wp_error->add( 'code', '' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /** |
| 448 | | * @covers ::add() |
| | 448 | * @covers ::add |
| 449 | 449 | */ |
| 450 | 450 | public function test_add_with_code_empty_message_empty_data_should_not_add_error_data() { |
| 451 | 451 | $this->wp_error->add( 'code', '' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | /** |
| 457 | | * @covers ::add() |
| | 457 | * @covers ::add |
| 458 | 458 | */ |
| 459 | 459 | public function test_add_with_code_and_message_and_empty_data_should_should_add_error_with_that_message() { |
| 460 | 460 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | /** |
| 466 | | * @covers ::add() |
| | 466 | * @covers ::add |
| 467 | 467 | */ |
| 468 | 468 | public function test_add_with_code_and_message_and_empty_data_should_not_alter_stored_data() { |
| 469 | 469 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | /** |
| 475 | | * @covers ::add() |
| | 475 | * @covers ::add |
| 476 | 476 | */ |
| 477 | 477 | public function test_add_with_code_and_empty_message_and_data_should_add_error_with_that_code() { |
| 478 | 478 | $this->wp_error->add( 'code', '', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | /** |
| 484 | | * @covers ::add() |
| | 484 | * @covers ::add |
| 485 | 485 | */ |
| 486 | 486 | public function test_add_with_code_and_empty_message_and_data_should_store_that_data() { |
| 487 | 487 | $this->wp_error->add( 'code', '', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | /** |
| 493 | | * @covers ::add() |
| | 493 | * @covers ::add |
| 494 | 494 | */ |
| 495 | 495 | public function test_add_with_code_and_message_and_data_should_add_an_error_with_that_code() { |
| 496 | 496 | $this->wp_error->add( 'code', 'message', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | /** |
| 502 | | * @covers ::add() |
| | 502 | * @covers ::add |
| 503 | 503 | */ |
| 504 | 504 | public function test_add_with_code_and_message_and_data_should_add_an_error_with_that_message() { |
| 505 | 505 | $this->wp_error->add( 'code', 'message', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | /** |
| 511 | | * @covers ::add() |
| | 511 | * @covers ::add |
| 512 | 512 | */ |
| 513 | 513 | public function test_add_with_code_and_message_and_data_should_store_that_data() { |
| 514 | 514 | $this->wp_error->add( 'code', 'message', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | /** |
| 520 | | * @covers ::add() |
| | 520 | * @covers ::add |
| 521 | 521 | */ |
| 522 | 522 | public function test_add_multiple_times_with_the_same_code_should_add_additional_messages_for_that_code() { |
| 523 | 523 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | /** |
| 532 | | * @covers ::add() |
| | 532 | * @covers ::add |
| 533 | 533 | */ |
| 534 | 534 | public function test_add_multiple_times_with_the_same_code_and_different_data_should_store_only_the_last_added_data() { |
| 535 | 535 | $this->wp_error->add( 'code', 'message', 'data-bar' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | /** |
| 542 | | * @covers ::add_data() |
| | 542 | * @covers ::add_data |
| 543 | 543 | */ |
| 544 | 544 | public function test_add_data_with_empty_data_empty_code_should_create_orphaned_data_with_no_error() { |
| 545 | 545 | $this->wp_error->add_data( '' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | /** |
| 551 | | * @covers ::add_data() |
| | 551 | * @covers ::add_data |
| 552 | 552 | */ |
| 553 | 553 | public function test_add_data_with_empty_data_empty_code_no_errors_should_create_data_under_an_empty_code_key() { |
| 554 | 554 | $this->wp_error->add_data( '' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | /** |
| 560 | | * @covers ::add_data() |
| | 560 | * @covers ::add_data |
| 561 | 561 | */ |
| 562 | 562 | public function test_add_data_with_data_empty_code_and_one_error_should_store_the_data_under_that_code() { |
| 563 | 563 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | /** |
| 570 | | * @covers ::add_data() |
| | 570 | * @covers ::add_data |
| 571 | 571 | */ |
| 572 | 572 | public function test_add_data_with_data_empty_code_and_multiple_errors_with_different_codes_should_store_it_under_the_first_code() { |
| 573 | 573 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | /** |
| 582 | | * @covers ::add_data() |
| | 582 | * @covers ::add_data |
| 583 | 583 | */ |
| 584 | 584 | public function test_add_data_with_data_empty_code_and_multiple_errors_with_same_code_should_store_it_under_the_first_code() { |
| 585 | 585 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | /** |
| 595 | | * @covers ::add_data() |
| | 595 | * @covers ::add_data |
| 596 | 596 | */ |
| 597 | 597 | public function test_add_data_with_data_and_code_and_no_errors_should_create_orphaned_data_with_no_error() { |
| 598 | 598 | $this->wp_error->add_data( 'data', 'code' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | /** |
| 604 | | * @covers ::add_data() |
| | 604 | * @covers ::add_data |
| 605 | 605 | */ |
| 606 | 606 | public function test_add_data_with_data_and_code_no_errors_should_create_data_under_that_code_key() { |
| 607 | 607 | $this->wp_error->add_data( 'data', 'code' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | /** |
| 613 | | * @covers ::add_data() |
| | 613 | * @covers ::add_data |
| 614 | 614 | */ |
| 615 | 615 | public function test_add_data_with_data_and_code_one_error_different_code_should_create_orphaned_data_with_no_error() { |
| 616 | 616 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | /** |
| 624 | | * @covers ::add_data() |
| | 624 | * @covers ::add_data |
| 625 | 625 | */ |
| 626 | 626 | public function test_add_data_with_data_and_code_one_error_different_code_should_create_data_under_that_code_key() { |
| 627 | 627 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | /** |
| 635 | | * @covers ::add_data() |
| | 635 | * @covers ::add_data |
| 636 | 636 | */ |
| 637 | 637 | public function test_add_data_with_data_and_code_should_add_data() { |
| 638 | 638 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | /** |
| 646 | | * @covers ::remove() |
| | 646 | * @covers ::remove |
| 647 | 647 | */ |
| 648 | 648 | public function test_remove_with_no_errors_should_affect_nothing() { |
| 649 | 649 | $before = $this->wp_error->errors; |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 656 | 656 | } |
| 657 | 657 | |
| 658 | 658 | /** |
| 659 | | * @covers ::remove() |
| | 659 | * @covers ::remove |
| 660 | 660 | */ |
| 661 | 661 | public function test_remove_empty_code_no_errors_should_affect_nothing() { |
| 662 | 662 | $before = $this->wp_error->errors; |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | /** |
| 672 | | * @covers ::remove() |
| | 672 | * @covers ::remove |
| 673 | 673 | */ |
| 674 | 674 | public function test_remove_empty_code_and_one_error_with_empty_string_code_should_remove_error() { |
| 675 | 675 | $before = $this->wp_error->errors; |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | /** |
| 687 | | * @covers ::remove() |
| | 687 | * @covers ::remove |
| 688 | 688 | */ |
| 689 | 689 | public function test_remove_empty_code_and_one_error_with_empty_string_code_should_remove_error_data() { |
| 690 | 690 | $this->wp_error->add( '', 'message', 'data' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /** |
| 700 | | * @covers ::remove() |
| | 700 | * @covers ::remove |
| 701 | 701 | */ |
| 702 | 702 | public function test_remove_should_remove_the_error_with_the_given_code() { |
| 703 | 703 | $this->wp_error->add( 'code', 'message' ); |
| … |
… |
class Tests_WP_Error extends WP_UnitTestCase { |
| 708 | 708 | } |
| 709 | 709 | |
| 710 | 710 | /** |
| 711 | | * @covers ::remove() |
| | 711 | * @covers ::remove |
| 712 | 712 | */ |
| 713 | 713 | public function test_remove_should_remove_the_error_data_associated_with_the_given_code() { |
| 714 | 714 | $this->wp_error->add( 'code', 'message', 'data' ); |
-
diff --git a/tests/phpunit/tests/post/nav-menu.php b/tests/phpunit/tests/post/nav-menu.php
index 7ae35e34d9..641b423cc1 100644
|
a
|
b
|
class Test_Nav_Menus extends WP_UnitTestCase { |
| 679 | 679 | /** |
| 680 | 680 | * Test _wp_delete_customize_changeset_dependent_auto_drafts. |
| 681 | 681 | * |
| 682 | | * @covers ::_wp_delete_customize_changeset_dependent_auto_drafts() |
| | 682 | * @covers ::_wp_delete_customize_changeset_dependent_auto_drafts |
| 683 | 683 | */ |
| 684 | 684 | function test_wp_delete_customize_changeset_dependent_auto_drafts() { |
| 685 | 685 | $auto_draft_post_id = $this->factory()->post->create( |
-
diff --git a/tests/phpunit/tests/post/types.php b/tests/phpunit/tests/post/types.php
index dfd5910a2b..4a74cfefbd 100644
|
a
|
b
|
class Tests_Post_Types extends WP_UnitTestCase { |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * @ticket 35985 |
| 71 | | * @covers ::register_post_type() |
| | 71 | * @covers ::register_post_type |
| 72 | 72 | */ |
| 73 | 73 | function test_register_post_type_exclude_from_search_should_default_to_opposite_value_of_public() { |
| 74 | 74 | /* |
| … |
… |
class Tests_Post_Types extends WP_UnitTestCase { |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * @ticket 35985 |
| 85 | | * @covers ::register_post_type() |
| | 85 | * @covers ::register_post_type |
| 86 | 86 | */ |
| 87 | 87 | function test_register_post_type_publicly_queryable_should_default_to_value_of_public() { |
| 88 | 88 | /* |
| … |
… |
class Tests_Post_Types extends WP_UnitTestCase { |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | 98 | * @ticket 35985 |
| 99 | | * @covers ::register_post_type() |
| | 99 | * @covers ::register_post_type |
| 100 | 100 | */ |
| 101 | 101 | function test_register_post_type_show_ui_should_default_to_value_of_public() { |
| 102 | 102 | /* |
| … |
… |
class Tests_Post_Types extends WP_UnitTestCase { |
| 110 | 110 | |
| 111 | 111 | /** |
| 112 | 112 | * @ticket 35985 |
| 113 | | * @covers ::register_post_type() |
| | 113 | * @covers ::register_post_type |
| 114 | 114 | */ |
| 115 | 115 | function test_register_post_type_show_in_menu_should_default_to_value_of_show_ui() { |
| 116 | 116 | /* |
| … |
… |
class Tests_Post_Types extends WP_UnitTestCase { |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * @ticket 35985 |
| 132 | | * @covers ::register_post_type() |
| | 132 | * @covers ::register_post_type |
| 133 | 133 | */ |
| 134 | 134 | function test_register_post_type_show_in_nav_menus_should_default_to_value_of_public() { |
| 135 | 135 | /* |
| … |
… |
class Tests_Post_Types extends WP_UnitTestCase { |
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | 145 | * @ticket 35985 |
| 146 | | * @covers ::register_post_type() |
| | 146 | * @covers ::register_post_type |
| 147 | 147 | */ |
| 148 | 148 | function test_register_post_type_show_in_admin_bar_should_default_to_value_of_show_in_menu() { |
| 149 | 149 | /* |
-
diff --git a/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php b/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php
index 94c7cf8103..8fc64c0f60 100644
|
a
|
b
|
class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca |
| 258 | 258 | * |
| 259 | 259 | * @ticket 45098 |
| 260 | 260 | * |
| 261 | | * @covers WP_REST_Block_Renderer_Controller::register_routes() |
| | 261 | * @covers WP_REST_Block_Renderer_Controller::register_routes |
| 262 | 262 | */ |
| 263 | 263 | public function test_register_routes() { |
| 264 | 264 | $dynamic_block_names = get_dynamic_block_names(); |
| … |
… |
class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca |
| 273 | 273 | * |
| 274 | 274 | * @ticket 45098 |
| 275 | 275 | * |
| 276 | | * @covers WP_REST_Block_Renderer_Controller::get_item() |
| | 276 | * @covers WP_REST_Block_Renderer_Controller::get_item |
| 277 | 277 | */ |
| 278 | 278 | public function test_get_item_without_permissions() { |
| 279 | 279 | wp_set_current_user( 0 ); |
| … |
… |
class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca |
| 305 | 305 | * |
| 306 | 306 | * @ticket 45098 |
| 307 | 307 | * |
| 308 | | * @covers WP_REST_Block_Renderer_Controller::get_item() |
| | 308 | * @covers WP_REST_Block_Renderer_Controller::get_item |
| 309 | 309 | */ |
| 310 | 310 | public function test_get_item_invalid_block_name() { |
| 311 | 311 | wp_set_current_user( self::$user_id ); |
| … |
… |
class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca |
| 322 | 322 | * |
| 323 | 323 | * @ticket 45098 |
| 324 | 324 | * |
| 325 | | * @covers WP_REST_Block_Renderer_Controller::get_item() |
| | 325 | * @covers WP_REST_Block_Renderer_Controller::get_item |
| 326 | 326 | */ |
| 327 | 327 | public function test_get_item_invalid_attribute() { |
| 328 | 328 | wp_set_current_user( self::$user_id ); |
| … |
… |
class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca |
| 343 | 343 | * |
| 344 | 344 | * @ticket 45098 |
| 345 | 345 | * |
| 346 | | * @covers WP_REST_Block_Renderer_Controller::get_item() |
| | 346 | * @covers WP_REST_Block_Renderer_Controller::get_item |
| 347 | 347 | */ |
| 348 | 348 | public function test_get_item_unrecognized_attribute() { |
| 349 | 349 | wp_set_current_user( self::$user_id ); |
| … |
… |
class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca |
| 364 | 364 | * |
| 365 | 365 | * @ticket 45098 |
| 366 | 366 | * |
| 367 | | * @covers WP_REST_Block_Renderer_Controller::get_item() |
| | 367 | * @covers WP_REST_Block_Renderer_Controller::get_item |
| 368 | 368 | */ |
| 369 | 369 | public function test_get_item_default_attributes() { |
| 370 | 370 | wp_set_current_user( self::$user_id ); |
| … |
… |
class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca |
| 396 | 396 | * |
| 397 | 397 | * @ticket 45098 |
| 398 | 398 | * |
| 399 | | * @covers WP_REST_Block_Renderer_Controller::get_item() |
| | 399 | * @covers WP_REST_Block_Renderer_Controller::get_item |
| 400 | 400 | */ |
| 401 | 401 | public function test_get_item() { |
| 402 | 402 | wp_set_current_user( self::$user_id ); |
| … |
… |
class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca |
| 589 | 589 | * |
| 590 | 590 | * @ticket 45098 |
| 591 | 591 | * |
| 592 | | * @covers WP_REST_Block_Renderer_Controller::get_item_schema() |
| | 592 | * @covers WP_REST_Block_Renderer_Controller::get_item_schema |
| 593 | 593 | */ |
| 594 | 594 | public function test_get_item_schema() { |
| 595 | 595 | $request = new WP_REST_Request( 'OPTIONS', self::$rest_api_route . self::$block_name ); |
-
diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php
index 3c6c668ff0..7bec6cc516 100644
|
a
|
b
|
class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te |
| 3537 | 3537 | /** |
| 3538 | 3538 | * Test update_item() with same template that no longer exists. |
| 3539 | 3539 | * |
| 3540 | | * @covers WP_REST_Posts_Controller::check_template() |
| | 3540 | * @covers WP_REST_Posts_Controller::check_template |
| 3541 | 3541 | * @ticket 39996 |
| 3542 | 3542 | */ |
| 3543 | 3543 | public function test_update_item_with_same_template_that_no_longer_exists() { |
-
diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php
index 3e59c0fa06..b0b0d1b55c 100644
|
a
|
b
|
class Tests_Theme extends WP_UnitTestCase { |
| 352 | 352 | /** |
| 353 | 353 | * Test _wp_keep_alive_customize_changeset_dependent_auto_drafts. |
| 354 | 354 | * |
| 355 | | * @covers ::_wp_keep_alive_customize_changeset_dependent_auto_drafts() |
| | 355 | * @covers ::_wp_keep_alive_customize_changeset_dependent_auto_drafts |
| 356 | 356 | */ |
| 357 | 357 | function test_wp_keep_alive_customize_changeset_dependent_auto_drafts() { |
| 358 | 358 | $nav_created_post_ids = $this->factory()->post->create_many( |
-
diff --git a/tests/phpunit/tests/widgets.php b/tests/phpunit/tests/widgets.php
index bc63a81d87..0ccd86e699 100644
|
a
|
b
|
class Tests_Widgets extends WP_UnitTestCase { |
| 740 | 740 | /** |
| 741 | 741 | * Tests for when 'sidebars_widgets' theme mod is populated. |
| 742 | 742 | * |
| 743 | | * @covers ::retrieve_widgets() |
| | 743 | * @covers ::retrieve_widgets |
| 744 | 744 | */ |
| 745 | 745 | function test_retrieve_widgets_with_theme_mod() { |
| 746 | 746 | global $sidebars_widgets, $_wp_sidebars_widgets; |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 804 | 804 | /** |
| 805 | 805 | * Tests for when sidebars widgets matches registered sidebars. |
| 806 | 806 | * |
| 807 | | * @covers ::retrieve_widgets() |
| | 807 | * @covers ::retrieve_widgets |
| 808 | 808 | */ |
| 809 | 809 | function test_retrieve_widgets_with_sidebars_widgets_matching_registered_sidebars() { |
| 810 | 810 | global $sidebars_widgets; |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 842 | 842 | /** |
| 843 | 843 | * Tests for when sidebars widgets doesn't match registered sidebars. |
| 844 | 844 | * |
| 845 | | * @covers ::retrieve_widgets() |
| | 845 | * @covers ::retrieve_widgets |
| 846 | 846 | */ |
| 847 | 847 | function test_retrieve_widgets_with_sidebars_widgets_not_matching_registered_sidebars() { |
| 848 | 848 | global $sidebars_widgets, $_wp_sidebars_widgets; |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 936 | 936 | /** |
| 937 | 937 | * Tests for Customizer mode. |
| 938 | 938 | * |
| 939 | | * @covers ::retrieve_widgets() |
| | 939 | * @covers ::retrieve_widgets |
| 940 | 940 | */ |
| 941 | 941 | function test_retrieve_widgets_for_customizer() { |
| 942 | 942 | global $sidebars_widgets, $_wp_sidebars_widgets; |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 1008 | 1008 | /** |
| 1009 | 1009 | * Tests for orphaned widgets being moved into inactive widgets. |
| 1010 | 1010 | * |
| 1011 | | * @covers ::retrieve_widgets() |
| | 1011 | * @covers ::retrieve_widgets |
| 1012 | 1012 | */ |
| 1013 | 1013 | function test_retrieve_widgets_move_orphaned_widgets_to_inactive() { |
| 1014 | 1014 | global $sidebars_widgets; |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 1043 | 1043 | /** |
| 1044 | 1044 | * Test _wp_remove_unregistered_widgets. |
| 1045 | 1045 | * |
| 1046 | | * @covers ::_wp_remove_unregistered_widgets() |
| | 1046 | * @covers ::_wp_remove_unregistered_widgets |
| 1047 | 1047 | */ |
| 1048 | 1048 | public function test__wp_remove_unregistered_widgets() { |
| 1049 | 1049 | $widgets = array( |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 1073 | 1073 | /** |
| 1074 | 1074 | * Two themes with one sidebar each should just map, switching to a theme not previously-active. |
| 1075 | 1075 | * |
| 1076 | | * @covers ::wp_map_sidebars_widgets() |
| | 1076 | * @covers ::wp_map_sidebars_widgets |
| 1077 | 1077 | */ |
| 1078 | 1078 | public function test_one_sidebar_each() { |
| 1079 | 1079 | $this->register_sidebars( array( 'primary' ) ); |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 1093 | 1093 | /** |
| 1094 | 1094 | * Sidebars with the same name should map, switching to a theme not previously-active. |
| 1095 | 1095 | * |
| 1096 | | * @covers ::wp_map_sidebars_widgets() |
| | 1096 | * @covers ::wp_map_sidebars_widgets |
| 1097 | 1097 | */ |
| 1098 | 1098 | public function test_sidebars_with_same_slug() { |
| 1099 | 1099 | $this->register_sidebars( array( 'primary', 'secondary' ) ); |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 1111 | 1111 | /** |
| 1112 | 1112 | * Make educated guesses on theme sidebars. |
| 1113 | 1113 | * |
| 1114 | | * @covers ::wp_map_sidebars_widgets() |
| | 1114 | * @covers ::wp_map_sidebars_widgets |
| 1115 | 1115 | */ |
| 1116 | 1116 | public function test_sidebar_guessing() { |
| 1117 | 1117 | $this->register_sidebars( array( 'primary', 'secondary' ) ); |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 1134 | 1134 | /** |
| 1135 | 1135 | * Make sure two sidebars that fall in the same group don't get the same menu assigned. |
| 1136 | 1136 | * |
| 1137 | | * @covers ::wp_map_sidebars_widgets() |
| | 1137 | * @covers ::wp_map_sidebars_widgets |
| 1138 | 1138 | */ |
| 1139 | 1139 | public function test_sidebar_guessing_one_menu_per_group() { |
| 1140 | 1140 | $this->register_sidebars( array( 'primary' ) ); |
| … |
… |
class Tests_Widgets extends WP_UnitTestCase { |
| 1155 | 1155 | /** |
| 1156 | 1156 | * Make sure two sidebars that fall in the same group get menus assigned from the same group. |
| 1157 | 1157 | * |
| 1158 | | * @covers ::wp_map_sidebars_widgets() |
| | 1158 | * @covers ::wp_map_sidebars_widgets |
| 1159 | 1159 | */ |
| 1160 | 1160 | public function test_sidebar_guessing_one_menu_per_sidebar() { |
| 1161 | 1161 | $this->register_sidebars( array( 'primary', 'main' ) ); |
-
diff --git a/tests/phpunit/tests/widgets/media-audio-widget.php b/tests/phpunit/tests/widgets/media-audio-widget.php
index aceba85711..c3e467094e 100644
|
a
|
b
|
class Test_WP_Widget_Media_Audio extends WP_UnitTestCase { |
| 85 | 85 | /** |
| 86 | 86 | * Test constructor. |
| 87 | 87 | * |
| 88 | | * @covers WP_Widget_Media_Audio::__construct() |
| | 88 | * @covers WP_Widget_Media_Audio::__construct |
| 89 | 89 | */ |
| 90 | 90 | function test_constructor() { |
| 91 | 91 | $widget = new WP_Widget_Media_Audio(); |
-
diff --git a/tests/phpunit/tests/widgets/media-gallery-widget.php b/tests/phpunit/tests/widgets/media-gallery-widget.php
index 509504f3d8..a855e643a2 100644
|
a
|
b
|
class Test_WP_Widget_Media_Gallery extends WP_UnitTestCase { |
| 29 | 29 | /** |
| 30 | 30 | * Test get_instance_schema method. |
| 31 | 31 | * |
| 32 | | * @covers WP_Widget_Media_Gallery::get_instance_schema() |
| | 32 | * @covers WP_Widget_Media_Gallery::get_instance_schema |
| 33 | 33 | */ |
| 34 | 34 | public function test_get_instance_schema() { |
| 35 | 35 | $widget = new WP_Widget_Media_Gallery(); |
| … |
… |
class Test_WP_Widget_Media_Gallery extends WP_UnitTestCase { |
| 51 | 51 | /** |
| 52 | 52 | * Test update() method. |
| 53 | 53 | * |
| 54 | | * @covers WP_Widget_Media_Gallery::render_media() |
| | 54 | * @covers WP_Widget_Media_Gallery::render_media |
| 55 | 55 | */ |
| 56 | 56 | public function test_render_media() { |
| 57 | 57 | $widget = new WP_Widget_Media_Gallery(); |
| … |
… |
class Test_WP_Widget_Media_Gallery extends WP_UnitTestCase { |
| 89 | 89 | /** |
| 90 | 90 | * Test enqueue_admin_scripts() method. |
| 91 | 91 | * |
| 92 | | * @covers WP_Widget_Media_Gallery::enqueue_admin_scripts() |
| | 92 | * @covers WP_Widget_Media_Gallery::enqueue_admin_scripts |
| 93 | 93 | */ |
| 94 | 94 | public function test_enqueue_admin_scripts() { |
| 95 | 95 | set_current_screen( 'widgets.php' ); |
| … |
… |
class Test_WP_Widget_Media_Gallery extends WP_UnitTestCase { |
| 108 | 108 | /** |
| 109 | 109 | * Test update() method. |
| 110 | 110 | * |
| 111 | | * @covers WP_Widget_Media_Gallery::update() |
| | 111 | * @covers WP_Widget_Media_Gallery::update |
| 112 | 112 | */ |
| 113 | 113 | public function test_update() { |
| 114 | 114 | $widget = new WP_Widget_Media_Gallery(); |
| … |
… |
class Test_WP_Widget_Media_Gallery extends WP_UnitTestCase { |
| 189 | 189 | /** |
| 190 | 190 | * Test render_control_template_scripts() method. |
| 191 | 191 | * |
| 192 | | * @covers WP_Widget_Media_Gallery::render_control_template_scripts() |
| | 192 | * @covers WP_Widget_Media_Gallery::render_control_template_scripts |
| 193 | 193 | */ |
| 194 | 194 | public function test_render_control_template_scripts() { |
| 195 | 195 | $widget = new WP_Widget_Media_Gallery(); |
-
diff --git a/tests/phpunit/tests/widgets/media-image-widget.php b/tests/phpunit/tests/widgets/media-image-widget.php
index 69006000b5..8367e79898 100644
|
a
|
b
|
class Test_WP_Widget_Media_Image extends WP_UnitTestCase { |
| 92 | 92 | /** |
| 93 | 93 | * Test constructor. |
| 94 | 94 | * |
| 95 | | * @covers WP_Widget_Media_Image::__construct() |
| | 95 | * @covers WP_Widget_Media_Image::__construct |
| 96 | 96 | */ |
| 97 | 97 | function test_constructor() { |
| 98 | 98 | $widget = new WP_Widget_Media_Image(); |
-
diff --git a/tests/phpunit/tests/widgets/media-video-widget.php b/tests/phpunit/tests/widgets/media-video-widget.php
index fa37e44c7b..296bb92965 100644
|
a
|
b
|
class Test_WP_Widget_Media_Video extends WP_UnitTestCase { |
| 29 | 29 | /** |
| 30 | 30 | * Test get_instance_schema method. |
| 31 | 31 | * |
| 32 | | * @covers WP_Widget_Media_Video::get_instance_schema() |
| | 32 | * @covers WP_Widget_Media_Video::get_instance_schema |
| 33 | 33 | */ |
| 34 | 34 | function test_get_instance_schema() { |
| 35 | 35 | $widget = new WP_Widget_Media_Video(); |
| … |
… |
class Test_WP_Widget_Media_Video extends WP_UnitTestCase { |
| 86 | 86 | /** |
| 87 | 87 | * Test constructor. |
| 88 | 88 | * |
| 89 | | * @covers WP_Widget_Media_Video::__construct() |
| | 89 | * @covers WP_Widget_Media_Video::__construct |
| 90 | 90 | */ |
| 91 | 91 | function test_constructor() { |
| 92 | 92 | $widget = new WP_Widget_Media_Video(); |
| … |
… |
class Test_WP_Widget_Media_Video extends WP_UnitTestCase { |
| 115 | 115 | /** |
| 116 | 116 | * Test get_instance_schema method. |
| 117 | 117 | * |
| 118 | | * @covers WP_Widget_Media_Video::update() |
| | 118 | * @covers WP_Widget_Media_Video::update |
| 119 | 119 | */ |
| 120 | 120 | function test_update() { |
| 121 | 121 | $widget = new WP_Widget_Media_Video(); |
| … |
… |
class Test_WP_Widget_Media_Video extends WP_UnitTestCase { |
| 215 | 215 | /** |
| 216 | 216 | * Test render_media method. |
| 217 | 217 | * |
| 218 | | * @covers WP_Widget_Media_Video::render_media() |
| 219 | | * @covers WP_Widget_Media_Video::inject_video_max_width_style() |
| | 218 | * @covers WP_Widget_Media_Video::render_media |
| | 219 | * @covers WP_Widget_Media_Video::inject_video_max_width_style |
| 220 | 220 | */ |
| 221 | 221 | function test_render_media() { |
| 222 | 222 | $test_movie_file = __FILE__ . '../../data/uploads/small-video.m4v'; |
| … |
… |
class Test_WP_Widget_Media_Video extends WP_UnitTestCase { |
| 303 | 303 | * |
| 304 | 304 | * @global WP_Scripts $wp_scripts |
| 305 | 305 | * @global WP_Styles $wp_styles |
| 306 | | * @covers WP_Widget_Media_Video::enqueue_preview_scripts() |
| | 306 | * @covers WP_Widget_Media_Video::enqueue_preview_scripts |
| 307 | 307 | */ |
| 308 | 308 | function test_enqueue_preview_scripts() { |
| 309 | 309 | global $wp_scripts, $wp_styles; |
| … |
… |
class Test_WP_Widget_Media_Video extends WP_UnitTestCase { |
| 328 | 328 | /** |
| 329 | 329 | * Test enqueue_admin_scripts method. |
| 330 | 330 | * |
| 331 | | * @covers WP_Widget_Media_Video::enqueue_admin_scripts() |
| | 331 | * @covers WP_Widget_Media_Video::enqueue_admin_scripts |
| 332 | 332 | */ |
| 333 | 333 | function test_enqueue_admin_scripts() { |
| 334 | 334 | set_current_screen( 'widgets.php' ); |
| … |
… |
class Test_WP_Widget_Media_Video extends WP_UnitTestCase { |
| 341 | 341 | /** |
| 342 | 342 | * Test render_control_template_scripts method. |
| 343 | 343 | * |
| 344 | | * @covers WP_Widget_Media_Video::render_control_template_scripts() |
| | 344 | * @covers WP_Widget_Media_Video::render_control_template_scripts |
| 345 | 345 | */ |
| 346 | 346 | function test_render_control_template_scripts() { |
| 347 | 347 | $widget = new WP_Widget_Media_Video(); |
-
diff --git a/tests/phpunit/tests/widgets/media-widget.php b/tests/phpunit/tests/widgets/media-widget.php
index 27a4d5af60..95c34ab5ae 100644
|
a
|
b
|
class Test_WP_Widget_Media extends WP_UnitTestCase { |
| 50 | 50 | /** |
| 51 | 51 | * Test constructor. |
| 52 | 52 | * |
| 53 | | * @covers WP_Widget_Media::__construct() |
| 54 | | * @covers WP_Widget_Media::_register() |
| | 53 | * @covers WP_Widget_Media::__construct |
| | 54 | * @covers WP_Widget_Media::_register |
| 55 | 55 | */ |
| 56 | 56 | function test_constructor() { |
| 57 | 57 | $widget = $this->get_mocked_class_instance(); |
| … |
… |
class Test_WP_Widget_Media extends WP_UnitTestCase { |
| 106 | 106 | * Test constructor in customize preview. |
| 107 | 107 | * |
| 108 | 108 | * @global WP_Customize_Manager $wp_customize |
| 109 | | * @covers WP_Widget_Media::__construct() |
| 110 | | * @covers WP_Widget_Media::_register() |
| | 109 | * @covers WP_Widget_Media::__construct |
| | 110 | * @covers WP_Widget_Media::_register |
| 111 | 111 | */ |
| 112 | 112 | function test_constructor_in_customize_preview() { |
| 113 | 113 | global $wp_customize; |
| … |
… |
class Test_WP_Widget_Media extends WP_UnitTestCase { |
| 228 | 228 | /** |
| 229 | 229 | * Test update method. |
| 230 | 230 | * |
| 231 | | * @covers WP_Widget_Media::update() |
| | 231 | * @covers WP_Widget_Media::update |
| 232 | 232 | */ |
| 233 | 233 | function test_update() { |
| 234 | 234 | $widget = $this->get_mocked_class_instance(); |
| … |
… |
class Test_WP_Widget_Media extends WP_UnitTestCase { |
| 314 | 314 | /** |
| 315 | 315 | * Test widget method. |
| 316 | 316 | * |
| 317 | | * @covers WP_Widget_Media::widget() |
| 318 | | * @covers WP_Widget_Media::render_media() |
| | 317 | * @covers WP_Widget_Media::widget |
| | 318 | * @covers WP_Widget_Media::render_media |
| 319 | 319 | */ |
| 320 | 320 | function test_widget() { |
| 321 | 321 | $args = array( |
| … |
… |
class Test_WP_Widget_Media extends WP_UnitTestCase { |
| 389 | 389 | /** |
| 390 | 390 | * Test form method. |
| 391 | 391 | * |
| 392 | | * @covers WP_Widget_Media::form() |
| | 392 | * @covers WP_Widget_Media::form |
| 393 | 393 | */ |
| 394 | 394 | function test_form() { |
| 395 | 395 | $widget = $this->get_mocked_class_instance(); |
| … |
… |
class Test_WP_Widget_Media extends WP_UnitTestCase { |
| 406 | 406 | /** |
| 407 | 407 | * Test display_media_state method. |
| 408 | 408 | * |
| 409 | | * @covers WP_Widget_Media::display_media_state() |
| | 409 | * @covers WP_Widget_Media::display_media_state |
| 410 | 410 | */ |
| 411 | 411 | function test_display_media_state() { |
| 412 | 412 | $widget = $this->get_mocked_class_instance(); |
| … |
… |
class Test_WP_Widget_Media extends WP_UnitTestCase { |
| 448 | 448 | /** |
| 449 | 449 | * Test enqueue_admin_scripts method. |
| 450 | 450 | * |
| 451 | | * @covers WP_Widget_Media::enqueue_admin_scripts() |
| | 451 | * @covers WP_Widget_Media::enqueue_admin_scripts |
| 452 | 452 | */ |
| 453 | 453 | function test_enqueue_admin_scripts() { |
| 454 | 454 | set_current_screen( 'widgets.php' ); |
| … |
… |
class Test_WP_Widget_Media extends WP_UnitTestCase { |
| 476 | 476 | /** |
| 477 | 477 | * Test has_content method. |
| 478 | 478 | * |
| 479 | | * @covers WP_Widget_Media::has_content() |
| | 479 | * @covers WP_Widget_Media::has_content |
| 480 | 480 | */ |
| 481 | 481 | function test_has_content() { |
| 482 | 482 | $attachment_id = self::factory()->attachment->create_object( |
-
diff --git a/tests/phpunit/tests/widgets/text-widget.php b/tests/phpunit/tests/widgets/text-widget.php
index f4d4c58a4e..caa25e0eb8 100644
|
a
|
b
|
class Test_WP_Widget_Text extends WP_UnitTestCase { |
| 75 | 75 | * Test register in customize preview. |
| 76 | 76 | * |
| 77 | 77 | * @global WP_Customize_Manager $wp_customize |
| 78 | | * @covers WP_Widget_Text::__construct() |
| 79 | | * @covers WP_Widget_Text::_register() |
| | 78 | * @covers WP_Widget_Text::__construct |
| | 79 | * @covers WP_Widget_Text::_register |
| 80 | 80 | */ |
| 81 | 81 | function test__register_in_customize_preview() { |
| 82 | 82 | global $wp_customize; |