Changeset 51220
- Timestamp:
- 06/23/2021 03:59:39 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/widgets/text-widget.php
r49215 r51220 732 732 $result = $widget->update( $instance, array() ); 733 733 $this->assertSame( $expected, $result ); 734 $this->assert True( ! empty( $expected['filter'] ), 'Expected filter prop to be truthy, to handle case where 4.8 is downgraded to 4.7.' );734 $this->assertNotEmpty( $expected['filter'], 'Expected filter prop to be truthy, to handle case where 4.8 is downgraded to 4.7.' ); 735 735 736 736 add_filter( 'map_meta_cap', array( $this, 'grant_unfiltered_html_cap' ), 10, 2 ); … … 766 766 ); 767 767 $result = $widget->update( $instance, array() ); 768 $this->assertSame ( $instance, $result, 'Updating a widget without visual prop and explicit filter=false leaves visual prop absent' );768 $this->assertSameSets( $instance, $result, 'Updating a widget without visual prop and explicit filter=false leaves visual prop absent' ); 769 769 770 770 // -- … … 775 775 ); 776 776 $result = $widget->update( $instance, array() ); 777 $this->assertSame ( $instance, $result, 'Updating a widget without visual prop and explicit filter=true leaves legacy prop absent.' );777 $this->assertSameSets( $instance, $result, 'Updating a widget without visual prop and explicit filter=true leaves legacy prop absent.' ); 778 778 779 779 // -- … … 796 796 ); 797 797 $result = $widget->update( $instance, $old_instance ); 798 $this->assertSame ( $expected, $result, 'Updating a pre-existing widget with visual mode forces filter to be true.' );798 $this->assertSameSets( $expected, $result, 'Updating a pre-existing widget with visual mode forces filter to be true.' ); 799 799 800 800 // -- … … 817 817 ) 818 818 ); 819 $this->assertSame ( $expected, $result, 'Updating a pre-existing visual widget retains visual mode when updated.' );819 $this->assertSameSets( $expected, $result, 'Updating a pre-existing visual widget retains visual mode when updated.' ); 820 820 821 821 // -- … … 838 838 ) 839 839 ); 840 $this->assertSame ( $expected, $result, 'Updating a pre-existing visual widget retains visual=true and supplies missing filter=true.' );840 $this->assertSameSets( $expected, $result, 'Updating a pre-existing visual widget retains visual=true and supplies missing filter=true.' ); 841 841 842 842 // -- … … 853 853 ); 854 854 $result = $widget->update( $instance, array() ); 855 $this->assert Equals( $expected, $result, 'Updating a widget with explicit visual=true and absent filter prop causes filter to be set to true.' );855 $this->assertSameSets( $expected, $result, 'Updating a widget with explicit visual=true and absent filter prop causes filter to be set to true.' ); 856 856 857 857 // -- … … 868 868 ) 869 869 ); 870 $this->assert Equals( $expected, $result, 'Updating a widget in legacy mode results in filter=false as if checkbox not checked.' );870 $this->assertSameSets( $expected, $result, 'Updating a widget in legacy mode results in filter=false as if checkbox not checked.' ); 871 871 872 872 // -- … … 891 891 ) 892 892 ); 893 $this->assertSame ( $expected, $result, 'Updating a widget that previously had legacy form results in filter allowed to be false.' );893 $this->assertSameSets( $expected, $result, 'Updating a widget that previously had legacy form results in filter allowed to be false.' ); 894 894 895 895 // -- … … 907 907 ) 908 908 ); 909 $this->assertSame ( $expected, $result, 'Updating a widget that had \'content\' as its filter value persists non-legacy mode. This only existed in WP 4.8.0.' );909 $this->assertSameSets( $expected, $result, 'Updating a widget that had \'content\' as its filter value persists non-legacy mode. This only existed in WP 4.8.0.' ); 910 910 911 911 // -- … … 928 928 ) 929 929 ); 930 $this->assert Equals( $expected, $result, 'Updating a pre-existing widget with the filter=content prop in WP 4.8.0 upgrades to filter=true&visual=true.' );930 $this->assertSameSets( $expected, $result, 'Updating a pre-existing widget with the filter=content prop in WP 4.8.0 upgrades to filter=true&visual=true.' ); 931 931 932 932 // -- … … 944 944 ) 945 945 ); 946 $this->assertSame ( $expected, $result, 'Updating a widget with filter=content (from WP 4.8.0) upgrades to filter=true&visual=true.' );946 $this->assertSameSets( $expected, $result, 'Updating a widget with filter=content (from WP 4.8.0) upgrades to filter=true&visual=true.' ); 947 947 } 948 948
Note: See TracChangeset
for help on using the changeset viewer.