Make WordPress Core


Ignore:
Timestamp:
10/17/2015 06:02:16 PM (11 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/manager.php

    r35225 r35242  
    252252         */
    253253        function test_return_url() {
    254                 wp_set_current_user( self::$factory->user->create( array( 'role' => 'author' ) ) );
     254                wp_set_current_user( self::factory()->user->create( array( 'role' => 'author' ) ) );
    255255                $this->assertEquals( get_admin_url(), $this->manager->get_return_url() );
    256256
    257                 wp_set_current_user( self::$factory->user->create( array( 'role' => 'administrator' ) ) );
     257                wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    258258                $this->assertTrue( current_user_can( 'edit_theme_options' ) );
    259259                $this->assertEquals( admin_url( 'themes.php' ), $this->manager->get_return_url() );
     
    302302         */
    303303        function test_customize_pane_settings() {
    304                 wp_set_current_user( self::$factory->user->create( array( 'role' => 'administrator' ) ) );
     304                wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    305305                $this->manager->register_controls();
    306306                $this->manager->prepare_controls();
Note: See TracChangeset for help on using the changeset viewer.