Make WordPress Core


Ignore:
Timestamp:
09/06/2022 10:03:10 PM (21 months ago)
Author:
SergeyBiryukov
Message:

Tests: Correctly use the factory method.

This replaces all non-static calls to the WP_UnitTestCase_Base::factory() method with static function calls, since the method is declared as static.

This is a consistency improvement for the test suite.

Follow up to [35225], [35242], [49603], [54087].

Props jrf.
See #55652.

File:
1 edited

Legend:

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

    r52010 r54088  
    138138     */
    139139    public function test_preview_standard_types_non_multidimensional() {
    140         wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
     140        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    141141        $_POST['customized'] = wp_slash( wp_json_encode( $this->post_data_overrides ) );
    142142
     
    217217     */
    218218    public function test_preview_standard_types_multidimensional() {
    219         wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
     219        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    220220        $_POST['customized'] = wp_slash( wp_json_encode( $this->post_data_overrides ) );
    221221
     
    363363     */
    364364    public function test_preview_custom_type() {
    365         wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
     365        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    366366        $type                = 'custom_type';
    367367        $post_data_overrides = array(
     
    552552     */
    553553    public function test_is_current_blog_previewed() {
    554         wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
     554        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    555555        $type       = 'option';
    556556        $name       = 'blogname';
     
    744744     */
    745745    public function test_multidimensional_value_when_previewed() {
    746         wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
     746        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    747747        WP_Customize_Setting::reset_aggregated_multidimensionals();
    748748
Note: See TracChangeset for help on using the changeset viewer.