Skip to content
Permalink
Browse files

Tests: Correct sidebar names for Twenty Twenty.

See #48110.

git-svn-id: https://develop.svn.wordpress.org/trunk@46282 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed Sep 23, 2019
1 parent 03fdd65 commit bb41a65acd3480ea443ef7040e0d269fdc42880d
Showing with 10 additions and 10 deletions.
  1. +4 −4 tests/phpunit/tests/customize/manager.php
  2. +6 −6 tests/phpunit/tests/customize/widgets.php
@@ -1777,8 +1777,8 @@ function test_wp_customize_publish_changeset() {
$old_sidebars_widgets = get_option( 'sidebars_widgets' );
$new_sidebars_widgets = $old_sidebars_widgets;
$this->assertGreaterThan( 2, count( $new_sidebars_widgets['sidebar-1'] ) );
$new_sidebar_1 = array_reverse( $new_sidebars_widgets['sidebar-1'] );
$this->assertGreaterThan( 2, count( $new_sidebars_widgets['footer-one'] ) );
$new_sidebar_1 = array_reverse( $new_sidebars_widgets['footer-one'] );
$post_id = $this->factory()->post->create(
array(
@@ -1787,7 +1787,7 @@ function test_wp_customize_publish_changeset() {
'post_name' => wp_generate_uuid4(),
'post_content' => wp_json_encode(
array(
'sidebars_widgets[sidebar-1]' => array(
'sidebars_widgets[footer-one]' => array(
'value' => $new_sidebar_1,
),
)
@@ -1804,7 +1804,7 @@ function test_wp_customize_publish_changeset() {
// Ensure that the value has actually been written to the DB.
$updated_sidebars_widgets = get_option( 'sidebars_widgets' );
$this->assertEquals( $new_sidebar_1, $updated_sidebars_widgets['sidebar-1'] );
$this->assertEquals( $new_sidebar_1, $updated_sidebars_widgets['footer-one'] );
}
/**
@@ -33,8 +33,8 @@ function setUp() {
unset( $GLOBALS['_wp_sidebars_widgets'] ); // clear out cache set by wp_get_sidebars_widgets()
$sidebars_widgets = wp_get_sidebars_widgets();
$this->assertEqualSets( array( 'wp_inactive_widgets', 'footer-one', 'footer-two' ), array_keys( wp_get_sidebars_widgets() ) );
$this->assertContains( 'search-2', $sidebars_widgets['sidebar-1'] );
$this->assertContains( 'categories-2', $sidebars_widgets['sidebar-1'] );
$this->assertContains( 'search-2', $sidebars_widgets['footer-one'] );
$this->assertContains( 'categories-2', $sidebars_widgets['footer-two'] );
$this->assertArrayHasKey( 2, get_option( 'widget_search' ) );
$widget_categories = get_option( 'widget_categories' );
$this->assertArrayHasKey( 2, $widget_categories );
@@ -101,7 +101,7 @@ function test_construct() {
* @ticket 36660
*/
function test_customize_register_with_deleted_sidebars() {
$sidebar_id = 'sidebar-1';
$sidebar_id = 'footer-one';
delete_option( 'sidebars_widgets' );
register_sidebar( array( 'id' => $sidebar_id ) );
$this->manager->widgets->customize_register();
@@ -311,11 +311,11 @@ function test_get_setting_args() {
'sanitize_callback' => array( $this->manager->widgets, 'sanitize_sidebar_widgets' ),
'sanitize_js_callback' => array( $this->manager->widgets, 'sanitize_sidebar_widgets_js_instance' ),
);
$args = $this->manager->widgets->get_setting_args( 'sidebars_widgets[sidebar-1]' );
$args = $this->manager->widgets->get_setting_args( 'sidebars_widgets[footer-one]' );
foreach ( $default_args as $key => $default_value ) {
$this->assertEquals( $default_value, $args[ $key ] );
}
$this->assertEquals( 'SIDEBARS_WIDGETS[SIDEBAR-1]', $args['uppercase_id_set_by_filter'] );
$this->assertEquals( 'SIDEBARS_WIDGETS[FOOTER-ONE]', $args['uppercase_id_set_by_filter'] );
$override_args = array(
'type' => 'theme_mod',
@@ -653,7 +653,7 @@ function test_render_widget_partial() {
$this->assertFalse( $this->manager->widgets->render_widget_partial( $partial, array() ) );
$this->assertFalse( $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'non-existing' ) ) );
$output = $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'sidebar-1' ) );
$output = $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'footer-one' ) );
$this->assertEquals( 1, substr_count( $output, 'data-customize-partial-id' ) );
$this->assertEquals( 1, substr_count( $output, 'data-customize-partial-type="widget"' ) );

0 comments on commit bb41a65

Please sign in to comment.
You can’t perform that action at this time.