Make WordPress Core

Ticket #65014: 65014-v2.diff

File 65014-v2.diff, 5.8 KB (added by valani9099, 2 months ago)

Updated patch v2 — moved dashicons class before error class for consistency per @sabernhardt suggestion.

  • src/wp-admin/css/common.css

    diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css
    index 28b881d363..b317af45e0 100644
    a b html.wp-toolbar { 
    22812281        line-height: 1;
    22822282}
    22832283
    2284 .postbox.closed {
     2284.postbox.closed .postbox-header {
    22852285        border-bottom: 0;
    22862286}
    22872287
  • src/wp-admin/includes/class-wp-site-health.php

    diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php
    index f10f0b2980..17ebd8a1c0 100644
    a b class WP_Site_Health { 
    13571357                        $result['description'] .= sprintf(
    13581358                                '<p>%s</p>',
    13591359                                sprintf(
    1360                                         '<span class="error dashicons"><span class="screen-reader-text">%s</span></span> %s',
     1360                                        '<span class="dashicons error"><span class="screen-reader-text">%s</span></span> %s',
    13611361                                        /* translators: Hidden accessibility text. */
    13621362                                        __( 'Error' ),
    13631363                                        sprintf(
  • tests/phpunit/tests/rest-api/rest-server.php

    diff --git a/tests/phpunit/tests/rest-api/rest-server.php b/tests/phpunit/tests/rest-api/rest-server.php
    index 440effe4fe..57b7bbb38a 100644
    a b class Tests_REST_Server extends WP_Test_REST_TestCase { 
    151151                $this->assertSame( $headers, $enveloped['headers'] );
    152152        }
    153153
     154        /**
     155         * Data provider.
     156         *
     157         * @return array
     158         */
     159        public function data_envelope_params() {
     160                return array(
     161                        array( '1' ),
     162                        array( 'true' ),
     163                        array( false ),
     164                        array( 'alternate' ),
     165                        array( array( 'alternate' ) ),
     166                );
     167        }
     168
    154169        public function test_default_param() {
    155170
    156171                register_rest_route(
    class Tests_REST_Server extends WP_Test_REST_TestCase { 
    17211736                $this->assertArrayNotHasKey( 'X-WP-Nonce', $headers );
    17221737        }
    17231738
     1739        /**
     1740         * Helper to setup a users and auth cookie global for the
     1741         * rest_send_refreshed_nonce related tests.
     1742         */
     1743        protected function helper_setup_user_for_rest_send_refreshed_nonce_tests() {
     1744                $author = self::factory()->user->create( array( 'role' => 'author' ) );
     1745                wp_set_current_user( $author );
     1746
     1747                global $wp_rest_auth_cookie;
     1748
     1749                $wp_rest_auth_cookie = true;
     1750        }
     1751
     1752        /**
     1753         * Helper to make the request and get the headers for the
     1754         * rest_send_refreshed_nonce related tests.
     1755         *
     1756         * @return array
     1757         */
     1758        protected function helper_make_request_and_return_headers_for_rest_send_refreshed_nonce_tests() {
     1759                $request = new WP_REST_Request( 'GET', '/', array() );
     1760                $result  = rest_get_server()->serve_request( '/' );
     1761
     1762                return rest_get_server()->sent_headers;
     1763        }
     1764
    17241765        /**
    17251766         * Refreshed nonce should be present in header when a valid nonce is
    17261767         * passed for logged in/anonymous user and not present when nonce is not
    class Tests_REST_Server extends WP_Test_REST_TestCase { 
    17511792                }
    17521793        }
    17531794
     1795        /**
     1796         * @return array {
     1797         *     @type array {
     1798         *         @type bool $has_logged_in_user Are we registering a user for the test.
     1799         *         @type bool $has_nonce          Is the nonce passed.
     1800         *     }
     1801         * }
     1802         */
     1803        public function data_rest_send_refreshed_nonce() {
     1804                return array(
     1805                        array( true, true ),
     1806                        array( true, false ),
     1807                        array( false, true ),
     1808                        array( false, false ),
     1809                );
     1810        }
     1811
    17541812        /**
    17551813         * Make sure that a sanitization that transforms the argument type will not
    17561814         * cause the validation to fail.
    class Tests_REST_Server extends WP_Test_REST_TestCase { 
    17901848                $this->assertSame( 200, $response->get_status() );
    17911849        }
    17921850
     1851        public function _validate_as_integer_123( $value, $request, $key ) {
     1852                if ( ! is_int( $value ) ) {
     1853                        return new WP_Error( 'some-error', 'This is not valid!' );
     1854                }
     1855
     1856                return true;
     1857        }
     1858
     1859        public function _validate_as_string_foo( $value, $request, $key ) {
     1860                if ( ! is_string( $value ) ) {
     1861                        return new WP_Error( 'some-error', 'This is not valid!' );
     1862                }
     1863
     1864                return true;
     1865        }
     1866
    17931867        /**
    17941868         * @ticket 43691
    17951869         */
    class Tests_REST_Server extends WP_Test_REST_TestCase { 
    26372711                $this->assertArrayHasKey( 'allow', $link['targetHints'] );
    26382712                $this->assertSame( array( 'GET', 'PUT' ), $link['targetHints']['allow'] );
    26392713        }
    2640 
    2641         public function _validate_as_integer_123( $value, $request, $key ) {
    2642                 if ( ! is_int( $value ) ) {
    2643                         return new WP_Error( 'some-error', 'This is not valid!' );
    2644                 }
    2645 
    2646                 return true;
    2647         }
    2648 
    2649         public function _validate_as_string_foo( $value, $request, $key ) {
    2650                 if ( ! is_string( $value ) ) {
    2651                         return new WP_Error( 'some-error', 'This is not valid!' );
    2652                 }
    2653 
    2654                 return true;
    2655         }
    2656 
    2657         /**
    2658          * @return array {
    2659          *     @type array {
    2660          *         @type bool $has_logged_in_user Are we registering a user for the test.
    2661          *         @type bool $has_nonce          Is the nonce passed.
    2662          *     }
    2663          * }
    2664          */
    2665         public function data_rest_send_refreshed_nonce() {
    2666                 return array(
    2667                         array( true, true ),
    2668                         array( true, false ),
    2669                         array( false, true ),
    2670                         array( false, false ),
    2671                 );
    2672         }
    2673 
    2674         /**
    2675          * Helper to setup a users and auth cookie global for the
    2676          * rest_send_refreshed_nonce related tests.
    2677          */
    2678         protected function helper_setup_user_for_rest_send_refreshed_nonce_tests() {
    2679                 $author = self::factory()->user->create( array( 'role' => 'author' ) );
    2680                 wp_set_current_user( $author );
    2681 
    2682                 global $wp_rest_auth_cookie;
    2683 
    2684                 $wp_rest_auth_cookie = true;
    2685         }
    2686 
    2687         /**
    2688          * Helper to make the request and get the headers for the
    2689          * rest_send_refreshed_nonce related tests.
    2690          *
    2691          * @return array
    2692          */
    2693         protected function helper_make_request_and_return_headers_for_rest_send_refreshed_nonce_tests() {
    2694                 $request = new WP_REST_Request( 'GET', '/', array() );
    2695                 $result  = rest_get_server()->serve_request( '/' );
    2696 
    2697                 return rest_get_server()->sent_headers;
    2698         }
    2699 
    2700         /**
    2701          * Data provider.
    2702          *
    2703          * @return array
    2704          */
    2705         public function data_envelope_params() {
    2706                 return array(
    2707                         array( '1' ),
    2708                         array( 'true' ),
    2709                         array( false ),
    2710                         array( 'alternate' ),
    2711                         array( array( 'alternate' ) ),
    2712                 );
    2713         }
    27142714}