Make WordPress Core

Ticket #39265: actions+admin.diff

File actions+admin.diff, 44.7 KB (added by Hudson Atwell, 4 years ago)

Adding @covers to Actions folder and Admin folder, Ajax and Attachment folders still need coverage. Hoping I did this well.

  • tests/phpunit/tests/admin/includesMisc.php

    From 9adb06afbb99ff5cff8b4398e4200460f7919852 Mon Sep 17 00:00:00 2001
    From: GITUSER <hudson@inboundnow.com>
    Date: Thu, 24 Sep 2020 18:25:50 -0500
    Subject: [PATCH] tests/admin
    
    ---
     tests/phpunit/tests/admin/includesMisc.php     |  3 ++
     tests/phpunit/tests/admin/includesPlugin.php   | 22 ++++++++++
     tests/phpunit/tests/admin/includesPost.php     | 59 ++++++++++++++++++++++++++
     tests/phpunit/tests/admin/includesSchema.php   |  3 ++
     tests/phpunit/tests/admin/includesScreen.php   | 53 +++++++++++++++++++++++
     tests/phpunit/tests/admin/includesTemplate.php | 17 ++++++++
     tests/phpunit/tests/admin/includesTheme.php    |  8 ++++
     7 files changed, 165 insertions(+)
    
    diff --git a/tests/phpunit/tests/admin/includesMisc.php b/tests/phpunit/tests/admin/includesMisc.php
    index 93951af..a6bf413 100644
    a b  
    44 * @group admin
    55 */
    66class Tests_Admin_includesMisc extends WP_UnitTestCase {
     7        /**
     8         * @covers ::shorten_url
     9         */
    710        function test_shorten_url() {
    811                $tests = array(
    912                        'wordpress\.org/about/philosophy'
  • tests/phpunit/tests/admin/includesPlugin.php

    diff --git a/tests/phpunit/tests/admin/includesPlugin.php b/tests/phpunit/tests/admin/includesPlugin.php
    index 310173b..0d9e532 100644
    a b  
    44 * @group admin
    55 */
    66class Tests_Admin_includesPlugin extends WP_UnitTestCase {
     7
     8        /**
     9         * @covers ::get_plugin_data
     10         */
    711        function test_get_plugin_data() {
    812                $data = get_plugin_data( DIR_TESTDATA . '/plugins/hello.php' );
    913
    class Tests_Admin_includesPlugin extends WP_UnitTestCase { 
    2731                }
    2832        }
    2933
     34        /**
     35         * @covers ::menu_page_url
     36         */
    3037        function test_menu_page_url() {
    3138                $current_user = get_current_user_id();
    3239                wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    class Tests_Admin_includesPlugin extends WP_UnitTestCase { 
    259266         * Test that when a submenu has the same slug as a parent item, that it's just appended and ignores the priority.
    260267         *
    261268         * @ticket 48599
     269         * @covers ::add_submenu_page
     270         *
    262271         */
    263272        function test_priority_when_parent_slug_child_slug_are_the_same() {
    264273                global $submenu, $menu;
    class Tests_Admin_includesPlugin extends WP_UnitTestCase { 
    291300         * Passing a string as priority will fail.
    292301         *
    293302         * @ticket 48599
     303         * @covers ::add_submenu_page
    294304         */
    295305        function test_passing_string_as_priority_fires_doing_it_wrong() {
    296306                $this->setExpectedIncorrectUsage( 'add_submenu_page' );
    class Tests_Admin_includesPlugin extends WP_UnitTestCase { 
    316326                $this->assertSame( 'submenu_page_1', $submenu['main_slug'][1][2] );
    317327        }
    318328
     329        /**
     330         * @covers ::is_plugin_active
     331         */
    319332        function test_is_plugin_active_true() {
    320333                activate_plugin( 'hello.php' );
    321334                $test = is_plugin_active( 'hello.php' );
    class Tests_Admin_includesPlugin extends WP_UnitTestCase { 
    324337                deactivate_plugins( 'hello.php' );
    325338        }
    326339
     340        /**
     341         * @covers ::is_plugin_active
     342         */
    327343        function test_is_plugin_active_false() {
    328344                deactivate_plugins( 'hello.php' );
    329345                $test = is_plugin_active( 'hello.php' );
    330346                $this->assertFalse( $test );
    331347        }
    332348
     349        /**
     350         * @covers ::is_plugin_inactive
     351         */
    333352        function test_is_plugin_inactive_true() {
    334353                deactivate_plugins( 'hello.php' );
    335354                $test = is_plugin_inactive( 'hello.php' );
    336355                $this->assertTrue( $test );
    337356        }
    338357
     358        /**
     359         * @covers ::is_plugin_inactive
     360         */
    339361        function test_is_plugin_inactive_false() {
    340362                activate_plugin( 'hello.php' );
    341363                $test = is_plugin_inactive( 'hello.php' );
  • tests/phpunit/tests/admin/includesPost.php

    diff --git a/tests/phpunit/tests/admin/includesPost.php b/tests/phpunit/tests/admin/includesPost.php
    index fcb74ce..ec1dddd 100644
    a b class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    2626                self::$post_id = $factory->post->create();
    2727        }
    2828
     29        /**
     30         * @covers ::_wp_translate_postdata
     31         */
    2932        function test__wp_translate_postdata_cap_checks_contributor() {
    3033                wp_set_current_user( self::$contributor_id );
    3134
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    7679                $this->assertSame( 'Sorry, you are not allowed to edit posts as this user.', $_results->get_error_message() );
    7780        }
    7881
     82        /**
     83         * @covers ::_wp_translate_postdata
     84         */
    7985        function test__wp_translate_postdata_cap_checks_editor() {
    8086                wp_set_current_user( self::$editor_id );
    8187
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    130136         * edit_post() should convert an existing auto-draft to a draft.
    131137         *
    132138         * @ticket 25272
     139         * @covers ::edit_post
    133140         */
    134141        function test_edit_post_auto_draft() {
    135142                wp_set_current_user( self::$editor_id );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    147154
    148155        /**
    149156         * @ticket 30615
     157         * @covers ::edit_post
    150158         */
    151159        public function test_edit_post_should_parse_tax_input_by_name_rather_than_slug_for_nonhierarchical_taxonomies() {
    152160                wp_set_current_user( self::$editor_id );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    187195
    188196        /**
    189197         * @ticket 30615
     198         * @covers ::edit_post
    190199         */
    191200        public function test_edit_post_should_not_create_terms_for_an_empty_tag_input_field() {
    192201                wp_set_current_user( self::$editor_id );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    216225
    217226        /**
    218227         * @ticket 27792
     228         * @covers ::bulk_edit_posts
    219229         */
    220230        public function test_bulk_edit_posts_stomping() {
    221231                wp_set_current_user( self::$admin_id );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    263273         * when it's unchanged.
    264274         *
    265275         * @ticket 44914
     276         * @covers ::bulk_edit_posts
    266277         */
    267278        public function test_bulk_edit_posts_should_preserve_post_format_when_unchanged() {
    268279                wp_set_current_user( self::$admin_id );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    295306
    296307        /**
    297308         * @ticket 41396
     309         * @covers ::bulk_edit_posts
    298310         */
    299311        public function test_bulk_edit_posts_should_set_post_format_before_wp_update_post_runs() {
    300312                wp_set_current_user( self::$admin_id );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    320332
    321333        /**
    322334         * @ticket 38293
     335         * @covers ::edit_post
    323336         */
    324337        public function test_user_cant_delete_protected_meta() {
    325338                $protected_meta_key = '_test_meta_data_that_is_protected';
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    354367
    355368        /**
    356369         * @ticket 30910
     370         * @covers ::get_sample_permalink
    357371         */
    358372        public function test_get_sample_permalink_should_return_pretty_permalink_for_posts_with_post_status_future() {
    359373                $permalink_structure = '%postname%';
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    377391        /**
    378392         * @ticket 30910
    379393         * @ticket 18306
     394         * @covers ::get_sample_permalink_html
    380395         */
    381396        public function test_get_sample_permalink_html_should_use_default_permalink_for_view_post_link_when_pretty_permalinks_are_disabled() {
    382397                wp_set_current_user( self::$admin_id );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    398413        /**
    399414         * @ticket 30910
    400415         * @ticket 18306
     416         * @covers ::get_sample_permalink_html
    401417         */
    402418        public function test_get_sample_permalink_html_should_use_pretty_permalink_for_view_post_link_when_pretty_permalinks_are_enabled() {
    403419                $this->set_permalink_structure( '/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    421437
    422438        /**
    423439         * @ticket 35980
     440         * @covers ::get_sample_permalink_html
    424441         */
    425442        public function test_get_sample_permalink_html_should_use_pretty_permalink_for_view_attachment_link_when_pretty_permalinks_are_enabled() {
    426443                $this->set_permalink_structure( '/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    447464        /**
    448465         * @ticket 32954
    449466         * @ticket 18306
     467         * @covers ::get_sample_permalink_html
    450468         */
    451469        public function test_get_sample_permalink_html_should_use_correct_permalink_for_view_post_link_when_changing_slug() {
    452470                $this->set_permalink_structure( '/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    505523        /**
    506524         * @ticket 30910
    507525         * @ticket 18306
     526         * @covers ::get_sample_permalink_html
    508527         */
    509528        public function test_get_sample_permalink_html_should_use_preview_links_for_draft_and_pending_posts_with_no_post_name() {
    510529                $this->set_permalink_structure( '/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    527546
    528547        /**
    529548         * @ticket 5305
     549         * @covers ::get_sample_permalink
    530550         */
    531551        public function test_get_sample_permalink_should_avoid_slugs_that_would_create_clashes_with_year_archives() {
    532552                $this->set_permalink_structure( '/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    543563
    544564        /**
    545565         * @ticket 5305
     566         * @covers ::get_sample_permalink
    546567         */
    547568        public function test_get_sample_permalink_should_allow_yearlike_slugs_if_permastruct_does_not_cause_an_archive_conflict() {
    548569                $this->set_permalink_structure( '/%year%/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    559580
    560581        /**
    561582         * @ticket 5305
     583         * @covers ::get_sample_permalink
    562584         */
    563585        public function test_get_sample_permalink_should_avoid_slugs_that_would_create_clashes_with_month_archives() {
    564586                $this->set_permalink_structure( '/%year%/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    575597
    576598        /**
    577599         * @ticket 5305
     600         * @covers ::get_sample_permalink
    578601         */
    579602        public function test_get_sample_permalink_should_ignore_potential_month_conflicts_for_invalid_monthnum() {
    580603                $this->set_permalink_structure( '/%year%/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    591614
    592615        /**
    593616         * @ticket 5305
     617         * @covers ::get_sample_permalink
    594618         */
    595619        public function test_get_sample_permalink_should_avoid_slugs_that_would_create_clashes_with_day_archives() {
    596620                $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    607631
    608632        /**
    609633         * @ticket 5305
     634         * @covers ::get_sample_permalink
    610635         */
    611636        public function test_get_sample_permalink_should_iterate_slug_suffix_when_a_date_conflict_is_found() {
    612637                $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    629654
    630655        /**
    631656         * @ticket 5305
     657         * @covers ::get_sample_permalink
    632658         */
    633659        public function test_get_sample_permalink_should_ignore_potential_day_conflicts_for_invalid_day() {
    634660                $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    645671
    646672        /**
    647673         * @ticket 5305
     674         * @covers ::get_sample_permalink
    648675         */
    649676        public function test_get_sample_permalink_should_allow_daylike_slugs_if_permastruct_does_not_cause_an_archive_conflict() {
    650677                $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    661688
    662689        /**
    663690         * @ticket 35368
     691         * @covers ::get_sample_permalink
    664692         */
    665693        public function test_get_sample_permalink_should_respect_hierarchy_of_draft_pages() {
    666694                $this->set_permalink_structure( '/%postname%/' );
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    686714                $this->assertSame( 'child-page', $actual[1] );
    687715        }
    688716
     717        /**
     718         * @covers ::post_exists
     719         */
    689720        public function test_post_exists_should_match_title() {
    690721                $p = self::factory()->post->create(
    691722                        array(
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    696727                $this->assertSame( $p, post_exists( 'Foo Bar' ) );
    697728        }
    698729
     730        /**
     731         * @covers ::post_exists
     732         */
    699733        public function test_post_exists_should_not_match_nonexistent_title() {
    700734                $p = self::factory()->post->create(
    701735                        array(
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    706740                $this->assertSame( 0, post_exists( 'Foo Bar Baz' ) );
    707741        }
    708742
     743        /**
     744         * @covers ::post_exists
     745         */
    709746        public function test_post_exists_should_match_nonempty_content() {
    710747                $title   = 'Foo Bar';
    711748                $content = 'Foo Bar Baz';
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    721758
    722759        /**
    723760         * @ticket 35246
     761         * @covers ::post_exists
    724762         */
    725763        public function test_post_exists_should_match_content_with_no_title() {
    726764                $title   = '';
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    735773                $this->assertSame( $p, post_exists( $title, $content ) );
    736774        }
    737775
     776        /**
     777         * @covers ::post_exists
     778         */
    738779        public function test_post_exists_should_not_match_when_nonempty_content_doesnt_match() {
    739780                $title   = 'Foo Bar';
    740781                $content = 'Foo Bar Baz';
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    748789                $this->assertSame( 0, post_exists( $title, $content ) );
    749790        }
    750791
     792        /**
     793         * @covers ::post_exists
     794         */
    751795        public function test_post_exists_should_match_nonempty_date() {
    752796                $title = 'Foo Bar';
    753797                $date  = '2014-05-08 12:00:00';
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    761805                $this->assertSame( $p, post_exists( $title, '', $date ) );
    762806        }
    763807
     808        /**
     809         * @covers ::post_exists
     810         */
    764811        public function test_post_exists_should_not_match_when_nonempty_date_doesnt_match() {
    765812                $title = 'Foo Bar';
    766813                $date  = '2014-05-08 12:00:00';
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    774821                $this->assertSame( 0, post_exists( $title, '', $date ) );
    775822        }
    776823
     824        /**
     825         * @covers ::post_exists
     826         */
    777827        public function test_post_exists_should_match_nonempty_title_content_and_date() {
    778828                $title   = 'Foo Bar';
    779829                $content = 'Foo Bar Baz';
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    789839                $this->assertSame( $p, post_exists( $title, $content, $date ) );
    790840        }
    791841
     842        /**
     843         * @covers ::use_block_editor_for_post
     844         */
    792845        function test_use_block_editor_for_post() {
    793846                $this->assertFalse( use_block_editor_for_post( -1 ) );
    794847                $bogus_post_id = $this->factory()->post->create(
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    822875                remove_filter( 'use_block_editor_for_post', '__return_true' );
    823876        }
    824877
     878        /**
     879         * @covers ::get_block_editor_server_block_settings
     880         */
    825881        function test_get_block_editor_server_block_settings() {
    826882                $name     = 'core/test';
    827883                $settings = array(
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    853909
    854910        /**
    855911         * @ticket 43559
     912         * @covers ::add_meta
    856913         */
    857914        public function test_post_add_meta_empty_is_allowed() {
    858915                $p = self::factory()->post->create();
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    872929         * Test the post type support in post_exists().
    873930         *
    874931         * @ticket 37406
     932         * @covers ::post_exists
    875933         */
    876934        public function test_post_exists_should_support_post_type() {
    877935                $title     = 'Foo Bar';
    class Tests_Admin_Includes_Post extends WP_UnitTestCase { 
    889947         * Test that post_exists() doesn't find an existing page as a post.
    890948         *
    891949         * @ticket 37406
     950         * @covers ::post_exists
    892951         */
    893952        public function test_post_exists_should_not_match_a_page_for_post() {
    894953                $title     = 'Foo Bar';
  • tests/phpunit/tests/admin/includesSchema.php

    diff --git a/tests/phpunit/tests/admin/includesSchema.php b/tests/phpunit/tests/admin/includesSchema.php
    index d770128..4c67982 100644
    a b class Tests_Admin_Includes_Schema extends WP_UnitTestCase { 
    9090        /**
    9191         * @ticket 44893
    9292         * @dataProvider data_populate_options
     93         * @covers ::populate_options
    9394         */
    9495        function test_populate_options( $options, $expected ) {
    9596                global $wpdb;
    class Tests_Admin_Includes_Schema extends WP_UnitTestCase { 
    182183         * @group multisite
    183184         * @group ms-required
    184185         * @dataProvider data_populate_site_meta
     186         * @covers ::populate_site_meta
    185187         */
    186188        function test_populate_site_meta( $meta, $expected ) {
    187189                global $wpdb;
    class Tests_Admin_Includes_Schema extends WP_UnitTestCase { 
    226228         * @ticket 44895
    227229         * @group multisite
    228230         * @dataProvider data_populate_network_meta
     231         * @covers ::populate_network_meta
    229232         */
    230233        function test_populate_network_meta( $meta, $expected ) {
    231234                global $wpdb;
  • tests/phpunit/tests/admin/includesScreen.php

    diff --git a/tests/phpunit/tests/admin/includesScreen.php b/tests/phpunit/tests/admin/includesScreen.php
    index c482ae3..c66e559 100644
    a b class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    167167                parent::tearDown();
    168168        }
    169169
     170        /**
     171         * @covers ::set_current_screen
     172         */
    170173        function test_set_current_screen_with_hook_suffix() {
    171174                global $current_screen;
    172175
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    235238                }
    236239        }
    237240
     241        /**
     242         * @covers ::convert_to_screen
     243         */
    238244        function test_post_type_as_hookname() {
    239245                $screen = convert_to_screen( 'page' );
    240246                $this->assertSame( $screen->post_type, 'page' );
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    243249                $this->assertTrue( $screen->is_block_editor );
    244250        }
    245251
     252        /**
     253         * @covers ::register_post_type
     254         * @covers ::convert_to_screen
     255         */
    246256        function test_post_type_with_special_suffix_as_hookname() {
    247257                register_post_type( 'value-add' );
    248258                $screen = convert_to_screen( 'value-add' ); // The '-add' part is key.
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    258268                $this->assertFalse( $screen->is_block_editor ); // Post types do not support `show_in_rest` by default.
    259269        }
    260270
     271        /**
     272         * @covers ::register_taxonomy
     273         * @covers ::convert_to_screen
     274         */
    261275        function test_taxonomy_with_special_suffix_as_hookname() {
    262276                register_taxonomy( 'old-or-new', 'post' );
    263277                $screen = convert_to_screen( 'edit-old-or-new' ); // The '-new' part is key.
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    267281                $this->assertFalse( $screen->is_block_editor );
    268282        }
    269283
     284        /**
     285         * @covers ::register_post_type
     286         * @covers ::convert_to_screen
     287         */
    270288        function test_post_type_with_edit_prefix() {
    271289                register_post_type( 'edit-some-thing' );
    272290                $screen = convert_to_screen( 'edit-some-thing' );
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    282300                $this->assertFalse( $screen->is_block_editor ); // Post types do not support `show_in_rest` by default.
    283301        }
    284302
     303        /**
     304         * @covers ::register_post_type
     305         * @covers ::convert_to_screen
     306         */
    285307        function test_post_type_edit_collisions() {
    286308                register_post_type( 'comments' );
    287309                register_post_type( 'tags' );
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    302324                $this->assertSame( $screen->base, 'post' );
    303325        }
    304326
     327        /**
     328         * @covers ::get_current_screen
     329         * @covers get_current_screen::add_help_tab
     330         * @covers get_current_screen::add_help_tabs
     331         * @covers get_current_screen::get_help_tab
     332         * @covers get_current_screen::get_help_tabs
     333         * @covers get_current_screen::remove_help_tab
     334         * @covers get_current_screen::remove_help_tabs
     335         */
    305336        function test_help_tabs() {
    306337                $tab      = __FUNCTION__;
    307338                $tab_args = array(
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    336367
    337368        /**
    338369         * @ticket 19828
     370         * @covers ::get_current_screen
     371         * @covers get_current_screen::add_help_tab
     372         * @covers get_current_screen::add_help_tabs
     373         * @covers get_current_screen::get_help_tab
     374         * @covers get_current_screen::get_help_tabs
     375         * @covers get_current_screen::remove_help_tab
     376         * @covers get_current_screen::remove_help_tabs
    339377         */
    340378        function test_help_tabs_priority() {
    341379                $tab_1      = 'tab1';
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    431469
    432470        /**
    433471         * @ticket 25799
     472         * @covers ::get_current_screen
     473         * @covers get_current_screen::add_option
     474         * @covers get_current_screen::get_option
     475         * @covers get_current_screen::get_options
     476         * @covers get_current_screen::remove_option
     477         * @covers get_current_screen::remove_options
    434478         */
    435479        function test_options() {
    436480                $option      = __FUNCTION__;
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    455499                $this->assertSame( $screen->get_options(), array() );
    456500        }
    457501
     502        /**
     503         * @covers ::get_current_screen
     504         * @covers ::set_current_screen
     505         * @covers get_current_screen::in_admin
     506         * @covers get_current_screen::get_options
     507         * @covers get_current_screen::remove_option
     508         * @covers get_current_screen::remove_options
     509         */
    458510        function test_in_admin() {
    459511                $screen = get_current_screen();
    460512
    class Tests_Admin_includesScreen extends WP_UnitTestCase { 
    606658         *     $function string Function name to hook to the filter.
    607659         * }
    608660         * @param bool   $expected The expected `is_block_editor` value.
     661         * @covers get_current_screen::is_block_editor
    609662         */
    610663        public function test_is_block_editor( $hook, $filter, $expected ) {
    611664                if ( ! empty( $filter['name'] ) && ! empty( $filter['function'] ) ) {
  • tests/phpunit/tests/admin/includesTemplate.php

    diff --git a/tests/phpunit/tests/admin/includesTemplate.php b/tests/phpunit/tests/admin/includesTemplate.php
    index 80a74eb..fb580a7 100644
    a b class Tests_Admin_includesTemplate extends WP_UnitTestCase { 
    77        /**
    88         * @ticket 51147
    99         * @dataProvider data_wp_terms_checklist_with_selected_cats
     10         * @covers ::wp_terms_checklist
    1011         */
    1112        public function test_wp_terms_checklist_with_selected_cats( $term_id ) {
    1213                $output = wp_terms_checklist(
    class Tests_Admin_includesTemplate extends WP_UnitTestCase { 
    2324        /**
    2425         * @ticket 51147
    2526         * @dataProvider data_wp_terms_checklist_with_selected_cats
     27         * @covers ::wp_terms_checklist
    2628         */
    2729        public function test_wp_terms_checklist_with_popular_cats( $term_id ) {
    2830                $output = wp_terms_checklist(
    class Tests_Admin_includesTemplate extends WP_UnitTestCase { 
    4345                );
    4446        }
    4547
     48        /**
     49         * @covers ::add_meta_box
     50         */
    4651        public function test_add_meta_box() {
    4752                global $wp_meta_boxes;
    4853
    class Tests_Admin_includesTemplate extends WP_UnitTestCase { 
    5156                $this->assertArrayHasKey( 'testbox1', $wp_meta_boxes['post']['advanced']['default'] );
    5257        }
    5358
     59        /**
     60         * @covers ::add_meta_box
     61         * @covers ::remove_meta_box
     62         */
    5463        public function test_remove_meta_box() {
    5564                global $wp_meta_boxes;
    5665
    class Tests_Admin_includesTemplate extends WP_UnitTestCase { 
    6978
    7079        /**
    7180         * @ticket 15000
     81         * @covers ::add_meta_box
    7282         */
    7383        public function test_add_meta_box_on_multiple_screens() {
    7484                global $wp_meta_boxes;
    class Tests_Admin_includesTemplate extends WP_UnitTestCase { 
    8393
    8494        /**
    8595         * @ticket 15000
     96         * @covers ::add_meta_box
     97         * @covers ::remove_meta_box
    8698         */
    8799        public function test_remove_meta_box_from_multiple_screens() {
    88100                global $wp_meta_boxes;
    class Tests_Admin_includesTemplate extends WP_UnitTestCase { 
    107119
    108120        /**
    109121         * @ticket 50019
     122         * @covers ::add_meta_box
     123         * @covers ::remove_meta_box
    110124         */
    111125        public function test_add_meta_box_with_previously_removed_box_and_sorted_priority() {
    112126                global $wp_meta_boxes;
    class Tests_Admin_includesTemplate extends WP_UnitTestCase { 
    130144         * @ticket 42498
    131145         * @covers ::get_settings_errors
    132146         * @global array $wp_settings_errors
     147         * @covers ::add_settings_error
     148         * @covers ::get_settings_errors
    133149         */
    134150        public function test_get_settings_errors_sources() {
    135151                global $wp_settings_errors;
    class Tests_Admin_includesTemplate extends WP_UnitTestCase { 
    171187         * @covers ::settings_errors
    172188         * @global array $wp_settings_errors
    173189         * @dataProvider settings_errors_css_classes_provider
     190         * @covers ::settings_errors
    174191         */
    175192        public function test_settings_errors_css_classes( $type, $expected ) {
    176193                global $wp_settings_errors;
  • tests/phpunit/tests/admin/includesTheme.php

    diff --git a/tests/phpunit/tests/admin/includesTheme.php b/tests/phpunit/tests/admin/includesTheme.php
    index ca842df..f3dff41 100644
    a b class Tests_Admin_includesTheme extends WP_UnitTestCase { 
    4141         * @ticket 11216
    4242         * @expectedDeprecated get_theme
    4343         * @expectedDeprecated get_themes
     44         * @covers ::get_page_templates
    4445         */
    4546        function test_page_templates() {
    4647                $theme = get_theme( 'Page Template Theme' );
    class Tests_Admin_includesTheme extends WP_UnitTestCase { 
    7475
    7576        /**
    7677         * @ticket 18375
     78         * @covers ::get_page_templates
    7779         */
    7880        function test_page_templates_different_post_types() {
    7981                $theme = wp_get_theme( 'page-templates' );
    class Tests_Admin_includesTheme extends WP_UnitTestCase { 
    100102
    101103        /**
    102104         * @ticket 38766
     105         * @covers ::get_page_templates
    103106         */
    104107        function test_page_templates_for_post_types_with_trailing_periods() {
    105108                $theme = wp_get_theme( 'page-templates' );
    class Tests_Admin_includesTheme extends WP_UnitTestCase { 
    132135
    133136        /**
    134137         * @ticket 38696
     138         * @covers ::get_page_templates
    135139         */
    136140        function test_page_templates_child_theme() {
    137141                $theme = wp_get_theme( 'page-templates-child' );
    class Tests_Admin_includesTheme extends WP_UnitTestCase { 
    171175
    172176        /**
    173177         * @ticket 41717
     178         * @covers ::wp_get_theme
     179         * @covers wp_get_theme::get_post_templates
    174180         */
    175181        public function test_get_post_templates_child_theme() {
    176182                $theme = wp_get_theme( 'page-templates-child' );
    class Tests_Admin_includesTheme extends WP_UnitTestCase { 
    215221         *
    216222         * @group external-http
    217223         * @ticket 28121
     224         * @covers ::get_theme_feature_list
    218225         */
    219226        function test_get_theme_featured_list_api() {
    220227                wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
    class Tests_Admin_includesTheme extends WP_UnitTestCase { 
    229236         *
    230237         * @group external-http
    231238         * @ticket 28121
     239         * @covers ::get_theme_feature_list
    232240         */
    233241        function test_get_theme_featured_list_hardcoded() {
    234242                $featured_list_hardcoded = get_theme_feature_list( false );
  • tests/phpunit/tests/admin/includesListTable.php

    -- 
    2.6.2.windows.1
    
    From 6a94978c6d0aa3905edd34f42f5efe9c0cf62920 Mon Sep 17 00:00:00 2001
    From: GITUSER <hudson@inboundnow.com>
    Date: Wed, 9 Sep 2020 16:35:26 -0500
    Subject: [PATCH] Working with Paul
    
    ---
     tests/phpunit/tests/admin/includesListTable.php | 22 +++++++---------------
     1 file changed, 7 insertions(+), 15 deletions(-)
    
    diff --git a/tests/phpunit/tests/admin/includesListTable.php b/tests/phpunit/tests/admin/includesListTable.php
    index 90669a3..4ef140c 100644
    a b class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    7575
    7676        /**
    7777         * @ticket 15459
    78          * @covers class::WP_Posts_List_Table
     78         * @covers WP_Posts_List_Table::list_hierarchical_page
    7979         */
    8080        function test_list_hierarchical_pages_first_page() {
    8181                $this->_test_list_hierarchical_page(
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    9292
    9393        /**
    9494         * @ticket 15459
    95          * @covers class::WP_Posts_List_Table
     95         * @covers WP_Posts_List_Table::list_hierarchical_page
    9696         */
    9797        function test_list_hierarchical_pages_second_page() {
    9898                $this->_test_list_hierarchical_page(
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    110110
    111111        /**
    112112         * @ticket 15459
    113          * @covers class::WP_Posts_List_Table
     113         * @covers WP_Posts_List_Table::list_hierarchical_page
    114114         */
    115115        function test_search_hierarchical_pages_first_page() {
    116116                $this->_test_list_hierarchical_page(
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    128128
    129129        /**
    130130         * @ticket 15459
    131          * @covers class::WP_Posts_List_Table
     131         * @covers WP_Posts_List_Table::list_hierarchical_page
    132132         */
    133133        function test_search_hierarchical_pages_second_page() {
    134134                $this->_test_list_hierarchical_page(
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    146146
    147147        /**
    148148         * @ticket 15459
    149          * @covers class::WP_Posts_List_Table
     149         * @covers WP_Posts_List_Table::list_hierarchical_page
    150150         */
    151151        function test_grandchildren_hierarchical_pages_first_page() {
    152152                // Page 6 is the first page with grandchildren.
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    166166
    167167        /**
    168168         * @ticket 15459
    169          * @covers class::WP_Posts_List_Table
     169         * @covers WP_Posts_List_Table::list_hierarchical_page
    170170         */
    171171        function test_grandchildren_hierarchical_pages_second_page() {
    172172                // Page 7 is the second page with grandchildren.
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    189189         *
    190190         * @param array $args         Query args for the list of pages.
    191191         * @param array $expected_ids Expected IDs of pages returned.
    192          * @covers class::WP_Posts_List_Table
     192         * @covers WP_Posts_List_Table::list_hierarchical_page
    193193         * @covers WP_Posts_List_Table::set_hierarchical_display
    194194         * @covers WP_Posts_List_Table::display_rows
    195195         */
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    236236
    237237        /**
    238238         * @ticket 37407
    239          * @covers class::WP_Posts_List_Table
    240239         * @covers WP_Posts_List_Table::extra_tablenav
    241240         */
    242241        function test_filter_button_should_not_be_shown_if_there_are_no_posts() {
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    252251
    253252        /**
    254253         * @ticket 37407
    255          * @covers class::WP_Posts_List_Table
    256254         * @covers WP_Posts_List_Table::extra_tablenav
    257255         */
    258256        function test_months_dropdown_should_not_be_shown_if_there_are_no_posts() {
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    268266
    269267        /**
    270268         * @ticket 37407
    271          * @covers class::WP_Posts_List_Table
    272269         * @covers WP_Posts_List_Table::extra_tablenav
    273270         */
    274271        function test_category_dropdown_should_not_be_shown_if_there_are_no_posts() {
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    284281
    285282        /**
    286283         * @ticket 38341
    287          * @covers class::WP_Posts_List_Table
    288284         * @covers WP_Posts_List_Table::extra_tablenav
    289285         */
    290286        public function test_empty_trash_button_should_not_be_shown_if_there_are_no_posts() {
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    301297        /**
    302298         * @ticket 40188
    303299         * @covers ::_get_list_table
    304          * @covers class::WP_Posts_List_Table
    305300         * @covers WP_Posts_List_Table::extra_tablenav
    306301         */
    307302        public function test_filter_button_should_not_be_shown_if_there_are_no_comments() {
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    317312        /**
    318313         * @ticket 40188
    319314         * @covers ::_get_list_table
    320          * @covers class::WP_Posts_List_Table
    321315         * @covers WP_Posts_List_Table::extra_tablenav
    322316         */
    323317        public function test_filter_button_should_be_shown_if_there_are_comments() {
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    342336        /**
    343337         * @ticket 40188
    344338         * @covers ::_get_list_table
    345          * @covers class::WP_Posts_List_Table
    346339         * @covers WP_Posts_List_Table::extra_tablenav
    347340         */
    348341        public function test_filter_comment_status_dropdown_should_be_shown_if_there_are_comments() {
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    383376
    384377        /**
    385378         * @ticket 45089
    386          * @covers class::WP_Posts_List_Table
    387379         * @covers WP_Posts_List_Table::get_sortable_columns
    388380         * @covers WP_Posts_List_Table::print_column_headers
    389381         */
  • tests/phpunit/tests/admin/includesListTable.php

    -- 
    2.6.2.windows.1
    
    From 9c6c7e3090810070a533774577688cc87b31e874 Mon Sep 17 00:00:00 2001
    From: GITUSER <hudson@inboundnow.com>
    Date: Tue, 8 Sep 2020 13:07:25 -0500
    Subject: [PATCH] adding covers to includesListTable.php, need to get help to
     see if I am doing this correctly.
    
    ---
     tests/phpunit/tests/admin/includesListTable.php | 18 ++++++++++++++++++
     1 file changed, 18 insertions(+)
    
    diff --git a/tests/phpunit/tests/admin/includesListTable.php b/tests/phpunit/tests/admin/includesListTable.php
    index e7268d0..90669a3 100644
    a b class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    300300
    301301        /**
    302302         * @ticket 40188
     303         * @covers ::_get_list_table
     304         * @covers class::WP_Posts_List_Table
     305         * @covers WP_Posts_List_Table::extra_tablenav
    303306         */
    304307        public function test_filter_button_should_not_be_shown_if_there_are_no_comments() {
    305308                $table = _get_list_table( 'WP_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    313316
    314317        /**
    315318         * @ticket 40188
     319         * @covers ::_get_list_table
     320         * @covers class::WP_Posts_List_Table
     321         * @covers WP_Posts_List_Table::extra_tablenav
    316322         */
    317323        public function test_filter_button_should_be_shown_if_there_are_comments() {
    318324                $post_id    = self::factory()->post->create();
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    335341
    336342        /**
    337343         * @ticket 40188
     344         * @covers ::_get_list_table
     345         * @covers class::WP_Posts_List_Table
     346         * @covers WP_Posts_List_Table::extra_tablenav
    338347         */
    339348        public function test_filter_comment_status_dropdown_should_be_shown_if_there_are_comments() {
    340349                $post_id    = self::factory()->post->create();
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    358367
    359368        /**
    360369         * @ticket 38341
     370         * @covers ::_get_list_table
     371         * @covers class::WP_Posts_List_Table
     372         * @covers WP_Posts_List_Table::extra_tablenav
    361373         */
    362374        public function test_empty_trash_button_should_not_be_shown_if_there_are_no_comments() {
    363375                $table = _get_list_table( 'WP_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    371383
    372384        /**
    373385         * @ticket 45089
     386         * @covers class::WP_Posts_List_Table
     387         * @covers WP_Posts_List_Table::get_sortable_columns
     388         * @covers WP_Posts_List_Table::print_column_headers
    374389         */
    375390        public function test_sortable_columns() {
    376391                require_once ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php';
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    405420
    406421        /**
    407422         * @ticket 45089
     423         * @covers class::WP_Posts_List_Table
     424         * @covers WP_Posts_List_Table::get_sortable_columns
     425         * @covers WP_Posts_List_Table::print_column_headers
    408426         */
    409427        public function test_sortable_columns_with_current_ordering() {
    410428                require_once ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php';
  • .gitignore

    -- 
    2.6.2.windows.1
    
    From 688fbda8a818ed0cbacc8596ec6bd14dff80528e Mon Sep 17 00:00:00 2001
    From: GITUSER <hudson@inboundnow.com>
    Date: Tue, 8 Sep 2020 12:58:13 -0500
    Subject: [PATCH] saving changes
    
    ---
     .gitignore                                            |  1 +
     tests/phpunit/tests/actions/callbacks.php             |  1 +
     tests/phpunit/tests/actions/closures.php              |  1 +
     tests/phpunit/tests/admin/includesComment.php         |  6 ++++++
     tests/phpunit/tests/admin/includesCommunityEvents.php | 12 ++++++++++++
     tests/phpunit/tests/admin/includesFile.php            |  2 ++
     tests/phpunit/tests/admin/includesListTable.php       | 17 +++++++++++++++++
     7 files changed, 40 insertions(+)
    
    diff --git a/.gitignore b/.gitignore
    index 01757f7..6eff812 100644
    a b wp-tests-config.php 
    7777
    7878# Files for local environment config
    7979/docker-compose.override.yml
     80.idea/
  • tests/phpunit/tests/actions/callbacks.php

    diff --git a/tests/phpunit/tests/actions/callbacks.php b/tests/phpunit/tests/actions/callbacks.php
    index fc58c33..2db504d 100644
    a b class Tests_Actions_Callbacks extends WP_UnitTestCase { 
    77
    88        /**
    99         * @ticket 23265
     10         * @covers ::has_action
    1011         */
    1112        function test_callback_representations() {
    1213                $tag = __FUNCTION__;
  • tests/phpunit/tests/actions/closures.php

    diff --git a/tests/phpunit/tests/actions/closures.php b/tests/phpunit/tests/actions/closures.php
    index d1a458e..a255419 100644
    a b class Tests_Actions_Closures extends WP_UnitTestCase { 
    99
    1010        /**
    1111         * @ticket 10493
     12         * @covers ::has_action
    1213         */
    1314        function test_action_closure() {
    1415                $tag     = 'test_action_closure';
  • tests/phpunit/tests/admin/includesComment.php

    diff --git a/tests/phpunit/tests/admin/includesComment.php b/tests/phpunit/tests/admin/includesComment.php
    index 1dcc6bb..5f687f0 100644
    a b class Tests_Admin_IncludesComment extends WP_UnitTestCase { 
    4747
    4848        /**
    4949         * Verify that both the comment date and author must match for a comment to exist.
     50         *
     51         * @covers ::comment_exists
    5052         */
    5153        public function test_must_match_date_and_author() {
    5254                $this->assertNull( comment_exists( 1, '2004-01-02 12:00:00' ) );
    class Tests_Admin_IncludesComment extends WP_UnitTestCase { 
    5557
    5658        /**
    5759         * @ticket 33871
     60         * @covers ::comment_exists
    5861         */
    5962        public function test_default_value_of_timezone_should_be_blog() {
    6063                $this->assertEquals( self::$post_id, comment_exists( 1, '2014-05-06 12:00:00' ) );
    class Tests_Admin_IncludesComment extends WP_UnitTestCase { 
    6265
    6366        /**
    6467         * @ticket 33871
     68         * @covers ::comment_exists
    6569         */
    6670        public function test_should_respect_timezone_blog() {
    6771                $this->assertEquals( self::$post_id, comment_exists( 1, '2014-05-06 12:00:00', 'blog' ) );
    class Tests_Admin_IncludesComment extends WP_UnitTestCase { 
    6973
    7074        /**
    7175         * @ticket 33871
     76         * @covers ::comment_exists
    7277         */
    7378        public function test_should_respect_timezone_gmt() {
    7479                $this->assertEquals( self::$post_id, comment_exists( 1, '2014-05-06 07:00:00', 'gmt' ) );
    class Tests_Admin_IncludesComment extends WP_UnitTestCase { 
    7681
    7782        /**
    7883         * @ticket 33871
     84         * @covers ::comment_exists
    7985         */
    8086        public function test_invalid_timezone_should_fall_back_on_blog() {
    8187                $this->assertEquals( self::$post_id, comment_exists( 1, '2014-05-06 12:00:00', 'not_a_valid_value' ) );
  • tests/phpunit/tests/admin/includesCommunityEvents.php

    diff --git a/tests/phpunit/tests/admin/includesCommunityEvents.php b/tests/phpunit/tests/admin/includesCommunityEvents.php
    index 5bae0d8..26c6dad 100644
    a b class Test_WP_Community_Events extends WP_UnitTestCase { 
    6060         * Test: get_events() should return an instance of WP_Error if the response code is not 200.
    6161         *
    6262         * @since 4.8.0
     63         *
     64         * @covers WP_Community_Events::get_events
    6365         */
    6466        public function test_get_events_bad_response_code() {
    6567                add_filter( 'pre_http_request', array( $this, '_http_request_bad_response_code' ) );
    class Test_WP_Community_Events extends WP_UnitTestCase { 
    7375         * Test: The response body should not be cached if the response code is not 200.
    7476         *
    7577         * @since 4.8.0
     78         *
     79         * @covers WP_Community_Events::get_cached_events
    7680         */
    7781        public function test_get_cached_events_bad_response_code() {
    7882                add_filter( 'pre_http_request', array( $this, '_http_request_bad_response_code' ) );
    class Test_WP_Community_Events extends WP_UnitTestCase { 
    108112         * the required properties.
    109113         *
    110114         * @since 4.8.0
     115         * @covers WP_Community_Events::get_events
    111116         */
    112117        public function test_get_events_invalid_response() {
    113118                add_filter( 'pre_http_request', array( $this, '_http_request_invalid_response' ) );
    class Test_WP_Community_Events extends WP_UnitTestCase { 
    121126         * Test: The response body should not be cached if it does not have the required properties.
    122127         *
    123128         * @since 4.8.0
     129         * @covers WP_Community_Events::get_cached_events
    124130         */
    125131        public function test_get_cached_events_invalid_response() {
    126132                add_filter( 'pre_http_request', array( $this, '_http_request_invalid_response' ) );
    class Test_WP_Community_Events extends WP_UnitTestCase { 
    156162         * an events array with individual events that have formatted time and date.
    157163         *
    158164         * @since 4.8.0
     165         * @covers WP_Community_Events::get_events
    159166         */
    160167        public function test_get_events_valid_response() {
    161168                add_filter( 'pre_http_request', array( $this, '_http_request_valid_response' ) );
    class Test_WP_Community_Events extends WP_UnitTestCase { 
    175182         * and date values for each event.
    176183         *
    177184         * @since 4.8.0
     185         * @covers WP_Community_Events::get_events
     186         * @covers WP_Community_Events::get_cached_events
    178187         */
    179188        public function test_get_cached_events_valid_response() {
    180189                add_filter( 'pre_http_request', array( $this, '_http_request_valid_response' ) );
    class Test_WP_Community_Events extends WP_UnitTestCase { 
    262271         * Test: get_events() should return the events with the WordCamp pinned in the prepared list.
    263272         *
    264273         * @since 4.9.7
     274         * @covers WP_Community_Events::get_events
    265275         */
    266276        public function test_get_events_pin_wordcamp() {
    267277                add_filter( 'pre_http_request', array( $this, '_http_request_valid_response_unpinned_wordcamp' ) );
    class Test_WP_Community_Events extends WP_UnitTestCase { 
    364374         * falls into the list.
    365375         *
    366376         * @since 4.9.7
     377         * @covers WP_Community_Events::get_events
    367378         */
    368379        public function test_get_events_dont_pin_multiple_wordcamps() {
    369380                add_filter( 'pre_http_request', array( $this, '_http_request_valid_response_multiple_wordcamps' ) );
    class Test_WP_Community_Events extends WP_UnitTestCase { 
    482493         * @dataProvider data_get_unsafe_client_ip
    483494         *
    484495         * @ticket 41083
     496         * @covers WP_Community_Events::get_unsafe_client_ip
    485497         */
    486498        public function test_get_unsafe_client_ip( $raw_ip, $expected_result ) {
    487499                $_SERVER['REMOTE_ADDR']    = 'this should not be used';
  • tests/phpunit/tests/admin/includesFile.php

    diff --git a/tests/phpunit/tests/admin/includesFile.php b/tests/phpunit/tests/admin/includesFile.php
    index a3af5da..e1e252f 100644
    a b class Tests_Admin_includesFile extends WP_UnitTestCase { 
    88
    99        /**
    1010         * @ticket 20449
     11         * @covers ::get_home_path
    1112         */
    1213        function test_get_home_path() {
    1314                $home    = get_option( 'home' );
    class Tests_Admin_includesFile extends WP_UnitTestCase { 
    3435
    3536        /**
    3637         * @ticket 43329
     38         * @covers ::download_url
    3739         */
    3840        public function test_download_url_non_200_response_code() {
    3941                add_filter( 'pre_http_request', array( $this, '_fake_download_url_non_200_response_code' ), 10, 3 );
  • tests/phpunit/tests/admin/includesListTable.php

    diff --git a/tests/phpunit/tests/admin/includesListTable.php b/tests/phpunit/tests/admin/includesListTable.php
    index 6ca5b61..e7268d0 100644
    a b class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    7575
    7676        /**
    7777         * @ticket 15459
     78         * @covers class::WP_Posts_List_Table
    7879         */
    7980        function test_list_hierarchical_pages_first_page() {
    8081                $this->_test_list_hierarchical_page(
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    9192
    9293        /**
    9394         * @ticket 15459
     95         * @covers class::WP_Posts_List_Table
    9496         */
    9597        function test_list_hierarchical_pages_second_page() {
    9698                $this->_test_list_hierarchical_page(
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    108110
    109111        /**
    110112         * @ticket 15459
     113         * @covers class::WP_Posts_List_Table
    111114         */
    112115        function test_search_hierarchical_pages_first_page() {
    113116                $this->_test_list_hierarchical_page(
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    125128
    126129        /**
    127130         * @ticket 15459
     131         * @covers class::WP_Posts_List_Table
    128132         */
    129133        function test_search_hierarchical_pages_second_page() {
    130134                $this->_test_list_hierarchical_page(
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    142146
    143147        /**
    144148         * @ticket 15459
     149         * @covers class::WP_Posts_List_Table
    145150         */
    146151        function test_grandchildren_hierarchical_pages_first_page() {
    147152                // Page 6 is the first page with grandchildren.
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    161166
    162167        /**
    163168         * @ticket 15459
     169         * @covers class::WP_Posts_List_Table
    164170         */
    165171        function test_grandchildren_hierarchical_pages_second_page() {
    166172                // Page 7 is the second page with grandchildren.
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    183189         *
    184190         * @param array $args         Query args for the list of pages.
    185191         * @param array $expected_ids Expected IDs of pages returned.
     192         * @covers class::WP_Posts_List_Table
     193         * @covers WP_Posts_List_Table::set_hierarchical_display
     194         * @covers WP_Posts_List_Table::display_rows
    186195         */
    187196        protected function _test_list_hierarchical_page( array $args, array $expected_ids ) {
    188197                $matches = array();
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    227236
    228237        /**
    229238         * @ticket 37407
     239         * @covers class::WP_Posts_List_Table
     240         * @covers WP_Posts_List_Table::extra_tablenav
    230241         */
    231242        function test_filter_button_should_not_be_shown_if_there_are_no_posts() {
    232243                // Set post type to a non-existent one.
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    241252
    242253        /**
    243254         * @ticket 37407
     255         * @covers class::WP_Posts_List_Table
     256         * @covers WP_Posts_List_Table::extra_tablenav
    244257         */
    245258        function test_months_dropdown_should_not_be_shown_if_there_are_no_posts() {
    246259                // Set post type to a non-existent one.
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    255268
    256269        /**
    257270         * @ticket 37407
     271         * @covers class::WP_Posts_List_Table
     272         * @covers WP_Posts_List_Table::extra_tablenav
    258273         */
    259274        function test_category_dropdown_should_not_be_shown_if_there_are_no_posts() {
    260275                // Set post type to a non-existent one.
    class Tests_Admin_includesListTable extends WP_UnitTestCase { 
    269284
    270285        /**
    271286         * @ticket 38341
     287         * @covers class::WP_Posts_List_Table
     288         * @covers WP_Posts_List_Table::extra_tablenav
    272289         */
    273290        public function test_empty_trash_button_should_not_be_shown_if_there_are_no_posts() {
    274291                // Set post type to a non-existent one.