WordPress.org

Make WordPress Core

Changeset 468 in tests


Ignore:
Timestamp:
10/25/2011 07:22:39 AM (7 years ago)
Author:
nacin
Message:

Add message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_admin_includes_screen.php

    r467 r468  
    5858            $screen = (object) $screen;
    5959            $hook = parse_url( $hook_name );
     60
    6061            if ( $hook[ 'query' ] ) {
    6162                $args = wp_parse_args( $hook[ 'query' ] );
     
    6768                    $GLOBALS[ 'typenow' ] = $_GET[ 'post_type' ] = $_POST[ 'post_type' ] = $_REQUEST[ 'post_type' ] = $screen->post_type;
    6869            }
     70
    6971            $GLOBALS[ 'hook_suffix' ] = $hook['path'];
    7072            set_current_screen();
     73
    7174            $this->assertEquals( $screen->id, $current_screen->id );
    7275            $this->assertEquals( $screen->base, $current_screen->base );
     
    8184
    8285            // With convert_to_screen(), the same ID should return the exact $current_screen.
    83             $this->assertSame( $current_screen, convert_to_screen( $screen->id ) );
     86            $this->assertSame( $current_screen, convert_to_screen( $screen->id ), $hook_name );
    8487
    8588            // With convert_to_screen(), the hook_suffix should return the exact $current_screen.
    8689            // But, convert_to_screen() cannot figure out ?taxonomy and ?post_type.
    8790            if ( ! $hook['query'] )
    88                 $this->assertSame( $current_screen, convert_to_screen( $GLOBALS['hook_suffix'] ) );
     91                $this->assertSame( $current_screen, convert_to_screen( $GLOBALS['hook_suffix'] ), $hook_name );
    8992        }
    9093    }
Note: See TracChangeset for help on using the changeset viewer.