Make WordPress Core

Changeset 46282


Ignore:
Timestamp:
09/23/2019 10:03:53 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Correct sidebar names for Twenty Twenty.

See #48110.

Location:
trunk/tests/phpunit/tests/customize
Files:
2 edited

Legend:

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

    r46206 r46282  
    17781778        $old_sidebars_widgets = get_option( 'sidebars_widgets' );
    17791779        $new_sidebars_widgets = $old_sidebars_widgets;
    1780         $this->assertGreaterThan( 2, count( $new_sidebars_widgets['sidebar-1'] ) );
    1781         $new_sidebar_1 = array_reverse( $new_sidebars_widgets['sidebar-1'] );
     1780        $this->assertGreaterThan( 2, count( $new_sidebars_widgets['footer-one'] ) );
     1781        $new_sidebar_1 = array_reverse( $new_sidebars_widgets['footer-one'] );
    17821782
    17831783        $post_id = $this->factory()->post->create(
     
    17881788                'post_content' => wp_json_encode(
    17891789                    array(
    1790                         'sidebars_widgets[sidebar-1]' => array(
     1790                        'sidebars_widgets[footer-one]' => array(
    17911791                            'value' => $new_sidebar_1,
    17921792                        ),
     
    18051805        // Ensure that the value has actually been written to the DB.
    18061806        $updated_sidebars_widgets = get_option( 'sidebars_widgets' );
    1807         $this->assertEquals( $new_sidebar_1, $updated_sidebars_widgets['sidebar-1'] );
     1807        $this->assertEquals( $new_sidebar_1, $updated_sidebars_widgets['footer-one'] );
    18081808    }
    18091809
  • trunk/tests/phpunit/tests/customize/widgets.php

    r46278 r46282  
    3434        $sidebars_widgets = wp_get_sidebars_widgets();
    3535        $this->assertEqualSets( array( 'wp_inactive_widgets', 'footer-one', 'footer-two' ), array_keys( wp_get_sidebars_widgets() ) );
    36         $this->assertContains( 'search-2', $sidebars_widgets['sidebar-1'] );
    37         $this->assertContains( 'categories-2', $sidebars_widgets['sidebar-1'] );
     36        $this->assertContains( 'search-2', $sidebars_widgets['footer-one'] );
     37        $this->assertContains( 'categories-2', $sidebars_widgets['footer-two'] );
    3838        $this->assertArrayHasKey( 2, get_option( 'widget_search' ) );
    3939        $widget_categories = get_option( 'widget_categories' );
     
    102102     */
    103103    function test_customize_register_with_deleted_sidebars() {
    104         $sidebar_id = 'sidebar-1';
     104        $sidebar_id = 'footer-one';
    105105        delete_option( 'sidebars_widgets' );
    106106        register_sidebar( array( 'id' => $sidebar_id ) );
     
    312312            'sanitize_js_callback' => array( $this->manager->widgets, 'sanitize_sidebar_widgets_js_instance' ),
    313313        );
    314         $args         = $this->manager->widgets->get_setting_args( 'sidebars_widgets[sidebar-1]' );
     314        $args         = $this->manager->widgets->get_setting_args( 'sidebars_widgets[footer-one]' );
    315315        foreach ( $default_args as $key => $default_value ) {
    316316            $this->assertEquals( $default_value, $args[ $key ] );
    317317        }
    318         $this->assertEquals( 'SIDEBARS_WIDGETS[SIDEBAR-1]', $args['uppercase_id_set_by_filter'] );
     318        $this->assertEquals( 'SIDEBARS_WIDGETS[FOOTER-ONE]', $args['uppercase_id_set_by_filter'] );
    319319
    320320        $override_args = array(
     
    654654        $this->assertFalse( $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'non-existing' ) ) );
    655655
    656         $output = $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'sidebar-1' ) );
     656        $output = $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'footer-one' ) );
    657657
    658658        $this->assertEquals( 1, substr_count( $output, 'data-customize-partial-id' ) );
Note: See TracChangeset for help on using the changeset viewer.