Changeset 56502 for trunk/tests/phpunit/tests/theme/wpThemeJson.php
- Timestamp:
- 09/01/2023 02:51:55 AM (2 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/theme/wpThemeJson.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r56101 r56502 3870 3870 } 3871 3871 3872 public function test_block_style_variations() { 3873 wp_set_current_user( static::$administrator_id ); 3874 3875 $expected = array( 3876 'version' => WP_Theme_JSON::LATEST_SCHEMA, 3877 'styles' => array( 3878 'blocks' => array( 3879 'core/button' => array( 3880 'color' => array( 3881 'background' => 'blue', 3882 ), 3883 'variations' => array( 3884 'outline' => array( 3885 'color' => array( 3886 'background' => 'purple', 3887 ), 3888 ), 3889 ), 3890 ), 3891 ), 3892 ), 3893 ); 3894 3895 $actual = WP_Theme_JSON::remove_insecure_properties( $expected ); 3896 3897 $this->assertSameSetsWithIndex( $expected, $actual ); 3898 } 3899 3900 public function test_block_style_variations_with_invalid_properties() { 3901 wp_set_current_user( static::$administrator_id ); 3902 3903 $partially_invalid_variation = array( 3904 'version' => WP_Theme_JSON::LATEST_SCHEMA, 3905 'styles' => array( 3906 'blocks' => array( 3907 'core/button' => array( 3908 'color' => array( 3909 'background' => 'blue', 3910 ), 3911 'variations' => array( 3912 'outline' => array( 3913 'color' => array( 3914 'background' => 'purple', 3915 ), 3916 'invalid' => array( 3917 'value' => 'should be stripped', 3918 ), 3919 ), 3920 ), 3921 ), 3922 ), 3923 ), 3924 ); 3925 3926 $expected = array( 3927 'version' => WP_Theme_JSON::LATEST_SCHEMA, 3928 'styles' => array( 3929 'blocks' => array( 3930 'core/button' => array( 3931 'color' => array( 3932 'background' => 'blue', 3933 ), 3934 'variations' => array( 3935 'outline' => array( 3936 'color' => array( 3937 'background' => 'purple', 3938 ), 3939 ), 3940 ), 3941 ), 3942 ), 3943 ), 3944 ); 3945 3946 $actual = WP_Theme_JSON::remove_insecure_properties( $partially_invalid_variation ); 3947 3948 $this->assertSameSetsWithIndex( $expected, $actual ); 3949 } 3950 3872 3951 /** 3873 3952 * @ticket 56611
Note: See TracChangeset
for help on using the changeset viewer.