Make WordPress Core


Ignore:
Timestamp:
03/19/2023 12:03:30 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use the data_ prefix for various data provider methods.

This aims to bring more consistency to the test suite, as the vast majority of data providers already use that prefix.

Includes moving some data providers next to the tests they are used in.

Follow-up to [55464].

See #57841.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/seemsUtf8.php

    r53562 r55562  
    1111         * `seems_utf8` returns true for utf-8 strings, false otherwise.
    1212         *
    13          * @dataProvider utf8_strings
     13         * @dataProvider data_seems_utf8_returns_true_for_utf8_strings
    1414         */
    15         public function test_returns_true_for_utf8_strings( $utf8_string ) {
     15        public function test_seems_utf8_returns_true_for_utf8_strings( $utf8_string ) {
    1616                // From http://www.i18nguy.com/unicode-example.html
    1717                $this->assertTrue( seems_utf8( $utf8_string ) );
    1818        }
    1919
    20         public function utf8_strings() {
     20        public function data_seems_utf8_returns_true_for_utf8_strings() {
    2121                $utf8_strings = file( DIR_TESTDATA . '/formatting/utf-8/utf-8.txt' );
    2222                foreach ( $utf8_strings as &$string ) {
     
    2828
    2929        /**
    30          * @dataProvider big5_strings
     30         * @dataProvider data_seems_utf8_returns_false_for_non_utf8_strings
    3131         */
    32         public function test_returns_false_for_non_utf8_strings( $big5_string ) {
     32        public function test_seems_utf8_returns_false_for_non_utf8_strings( $big5_string ) {
    3333                $this->assertFalse( seems_utf8( $big5_string ) );
    3434        }
    3535
    36         public function big5_strings() {
     36        public function data_seems_utf8_returns_false_for_non_utf8_strings() {
    3737                // Get data from formatting/big5.txt.
    3838                $big5_strings = file( DIR_TESTDATA . '/formatting/big5.txt' );
Note: See TracChangeset for help on using the changeset viewer.