Make WordPress Core


Ignore:
Timestamp:
11/29/2022 12:32:37 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Add visibility to methods in tests/phpunit/tests/.

Adds a public visibility to test fixtures, tests, data providers, and callbacks methods. This continues the previous efforts to make sure visibility is declared on all methods.

Note: This will be enforced by WPCS 3.0.0.

Follow-up to [51919], [52009], [52010].

Props jrf.
See #56791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/kses.php

    r54675 r54889  
    16481648     * @param string $expected The expected result from KSES.
    16491649     */
    1650     function test_wp_kses_object_tag_allowed( $html, $expected ) {
     1650    public function test_wp_kses_object_tag_allowed( $html, $expected ) {
    16511651        $this->assertSame( $expected, wp_kses_post( $html ) );
    16521652    }
     
    16551655     * Data provider for test_wp_kses_object_tag_allowed().
    16561656     */
    1657     function data_wp_kses_object_tag_allowed() {
     1657    public function data_wp_kses_object_tag_allowed() {
    16581658        return array(
    16591659            'valid value for type'                    => array(
     
    17581758     * @param string $expected The expected result from KSES.
    17591759     */
    1760     function test_wp_kses_object_data_url_with_port_number_allowed( $html, $expected ) {
     1760    public function test_wp_kses_object_data_url_with_port_number_allowed( $html, $expected ) {
    17611761        add_filter( 'upload_dir', array( $this, 'wp_kses_upload_dir_filter' ), 10, 2 );
    17621762        $this->assertSame( $expected, wp_kses_post( $html ) );
     
    17661766     * Data provider for test_wp_kses_object_data_url_with_port_number_allowed().
    17671767     */
    1768     function data_wp_kses_object_data_url_with_port_number_allowed() {
     1768    public function data_wp_kses_object_data_url_with_port_number_allowed() {
    17691769        return array(
    17701770            'url with port number'                   => array(
     
    18051805     * @ticket 54261
    18061806     */
    1807     function test_wp_kses_object_added_in_html_filter() {
     1807    public function test_wp_kses_object_added_in_html_filter() {
    18081808        $html = <<<HTML
    18091809<object type="application/pdf" data="https://wordpress.org/foo.pdf" />
     
    18221822    }
    18231823
    1824     function filter_wp_kses_object_added_in_html_filter( $tags, $context ) {
     1824    public function filter_wp_kses_object_added_in_html_filter( $tags, $context ) {
    18251825        if ( 'post' === $context ) {
    18261826            $tags['object'] = array(
     
    18491849     * @param array  $allowed_html The allowed HTML to pass to KSES.
    18501850     */
    1851     function test_wp_kses_allowed_values_list( $html, $expected, $allowed_html ) {
     1851    public function test_wp_kses_allowed_values_list( $html, $expected, $allowed_html ) {
    18521852        $this->assertSame( $expected, wp_kses( $html, $allowed_html ) );
    18531853    }
     
    18561856     * Data provider for test_wp_kses_allowed_values_list().
    18571857     */
    1858     function data_wp_kses_allowed_values_list() {
     1858    public function data_wp_kses_allowed_values_list() {
    18591859        $data = array(
    18601860            'valid dir attribute value'             => array(
     
    19071907     * @param array  $allowed_html The allowed HTML to pass to KSES.
    19081908     */
    1909     function test_wp_kses_required_attribute( $html, $expected, $allowed_html ) {
     1909    public function test_wp_kses_required_attribute( $html, $expected, $allowed_html ) {
    19101910        $this->assertSame( $expected, wp_kses( $html, $allowed_html ) );
    19111911    }
     
    19141914     * Data provider for test_wp_kses_required_attribute().
    19151915     */
    1916     function data_wp_kses_required_attribute() {
     1916    public function data_wp_kses_required_attribute() {
    19171917        $data = array(
    19181918            'valid dir attribute value'             => array(
Note: See TracChangeset for help on using the changeset viewer.