WordPress.org

Make WordPress Core

Changeset 547 in tests


Ignore:
Timestamp:
02/17/2012 11:35:26 PM (10 years ago)
Author:
nacin
Message:

Add help tab tests. see #WP19974.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_admin_includes_screen.php

    r482 r547  
    156156        $this->assertEquals( $screen->base, 'post' );
    157157    }
     158
     159    function test_help_tabs() {
     160        $tab = rand_str();
     161        $tab_args = array(
     162            'id' => $tab,
     163            'title' => 'Help!',
     164            'content' => 'Some content',
     165            'callback' => false,
     166        );
     167
     168        $screen = get_current_screen();
     169        $screen->add_help_tab( $tab_args );
     170        $this->assertEquals( $screen->get_help_tab( $tab ), $tab_args );
     171
     172        $tabs = $screen->get_help_tabs();
     173        $this->assertArrayHasKey( $tab, $tabs );
     174
     175        $screen->remove_help_tab( $tab );
     176        $this->assertNull( $screen->get_help_tab( $tab ) );
     177
     178        $screen->remove_help_tabs();
     179        $this->assertEquals( $screen->get_help_tabs(), array() );
     180    }
    158181}
Note: See TracChangeset for help on using the changeset viewer.