WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/17/2015 06:02:16 PM (6 years ago)
Author:
wonderboymusic
Message:

Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop.

Props nerrad, wonderboymusic.
See #30017, #33968.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/panel.php

    r35225 r35242  
    129129     */
    130130    function test_check_capabilities() {
    131         $user_id = self::$factory->user->create( array( 'role' => 'administrator' ) );
     131        $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
    132132        wp_set_current_user( $user_id );
    133133
     
    155155     */
    156156    function test_maybe_render() {
    157         wp_set_current_user( self::$factory->user->create( array( 'role' => 'administrator' ) ) );
     157        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    158158        $panel = new WP_Customize_Panel( $this->manager, 'bar' );
    159159        $customize_render_panel_count = did_action( 'customize_render_panel' );
     
    180180     */
    181181    function test_print_templates_standard() {
    182         wp_set_current_user( self::$factory->user->create( array( 'role' => 'administrator' ) ) );
     182        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    183183
    184184        $panel = new WP_Customize_Panel( $this->manager, 'baz' );
     
    198198     */
    199199    function test_print_templates_custom() {
    200         wp_set_current_user( self::$factory->user->create( array( 'role' => 'administrator' ) ) );
     200        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    201201
    202202        $panel = new Custom_Panel_Test( $this->manager, 'baz' );
Note: See TracChangeset for help on using the changeset viewer.