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/setting.php

    r35225 r35242  
    395395
    396396        // Satisfy all requirements for save to happen.
    397         wp_set_current_user( self::$factory->user->create( array( 'role' => 'administrator' ) ) );
     397        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    398398        $this->assertTrue( false !== $setting->save() );
    399399        $this->assertTrue( 1 === did_action( 'customize_update_custom' ) );
     
    466466        $this->assertTrue( $setting->is_current_blog_previewed() );
    467467
    468         $blog_id = self::$factory->blog->create();
     468        $blog_id = self::factory()->blog->create();
    469469        switch_to_blog( $blog_id );
    470470        $this->assertFalse( $setting->is_current_blog_previewed() );
Note: See TracChangeset for help on using the changeset viewer.