Make WordPress Core

Changeset 36610


Ignore:
Timestamp:
02/22/2016 05:09:34 AM (10 years ago)
Author:
westonruter
Message:

Customize: Update unit test for WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item() to account for slashing if user can't unfiltered_html.

Fixes unit tests which broke under multisite config after [36608].

Fixes #35869.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/nav-menu-item-setting.php

    r36608 r36610  
    768768                        'position'         => 2,
    769769                        'type'             => 'post_type',
    770                         'title'            => 'Hello World',
     770                        'title'            => 'Hello \o/ o\'o World',
    771771                        'url'              => '',
    772772                        'target'           => '',
    773                         'attr_title'       => '">attempted <b>baddie</b>',
    774                         'description'      => 'Attempted <b>markup</b>',
     773                        'attr_title'       => '">att \o/ o\'o empted <b>baddie</b>',
     774                        'description'      => 'Attempted \o/ o\'o <b>markup</b>',
    775775                        'classes'          => '',
    776776                        'xfn'              => '',
     
    796796                $this->assertEquals( wp_get_current_user()->ID, $nav_menu_item->post_author );
    797797                $this->assertObjectHasAttribute( 'type_label', $nav_menu_item );
    798                 $this->assertEquals( apply_filters( 'nav_menu_attr_title', apply_filters( 'excerpt_save_pre', $post_value['attr_title'] ) ), $nav_menu_item->attr_title );
    799                 $this->assertEquals( 'Attempted markup', $nav_menu_item->description );
     798                $expected = apply_filters( 'nav_menu_attr_title', wp_unslash( apply_filters( 'excerpt_save_pre', wp_slash( $post_value['attr_title'] ) ) ) );
     799                $this->assertEquals( $expected, $nav_menu_item->attr_title );
     800                $this->assertEquals( 'Attempted \o/ o&#8217;o markup', $nav_menu_item->description );
    800801        }
    801802}
Note: See TracChangeset for help on using the changeset viewer.