Make WordPress Core


Ignore:
Timestamp:
01/14/2024 05:15:49 PM (8 months ago)
Author:
SergeyBiryukov
Message:

Tests: Move wp_parse_list() tests to their own file.

This aims to make the tests more discoverable and easier to expand.

Follow-up to [44546].

See #59647.

File:
1 edited

Legend:

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

    r57239 r57284  
    725725
    726726        update_option( 'blog_charset', $orig_blog_charset );
    727     }
    728 
    729     /**
    730      * @ticket 43977
    731      * @dataProvider data_wp_parse_list
    732      */
    733     public function test_wp_parse_list( $expected, $actual ) {
    734         $this->assertSame( $expected, array_values( wp_parse_list( $actual ) ) );
    735     }
    736 
    737     public function data_wp_parse_list() {
    738         return array(
    739             array( array( '1', '2', '3', '4' ), '1,2,3,4' ),
    740             array( array( 'apple', 'banana', 'carrot', 'dog' ), 'apple,banana,carrot,dog' ),
    741             array( array( '1', '2', 'apple', 'banana' ), '1,2,apple,banana' ),
    742             array( array( '1', '2', 'apple', 'banana' ), '1, 2,apple,banana' ),
    743             array( array( '1', '2', 'apple', 'banana' ), '1,2,apple,,banana' ),
    744             array( array( '1', '2', 'apple', 'banana' ), ',1,2,apple,banana' ),
    745             array( array( '1', '2', 'apple', 'banana' ), '1,2,apple,banana,' ),
    746             array( array( '1', '2', 'apple', 'banana' ), '1,2 ,apple,banana' ),
    747             array( array(), '' ),
    748             array( array(), ',' ),
    749             array( array(), ',,' ),
    750         );
    751727    }
    752728
Note: See TracChangeset for help on using the changeset viewer.