WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/22/2014 08:56:23 PM (7 years ago)
Author:
boonebgorges
Message:

Repair the seems_utf8() tests that use Big5 encoding.

  • Provide sample data that is actually encoded in Big5.
  • Do some actual assertions against that data.

Props akumria.
Fixes #30455.

File:
1 edited

Legend:

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

    r25379 r30525  
    1111     * @dataProvider utf8_strings
    1212     */
    13     function test_returns_true_for_utf8_strings( $utf8_string ) {
     13    function test_returns_true_for_utf8_strings( $utf8_string ) {
    1414        // from http://www.i18nguy.com/unicode-example.html
    1515        $this->assertTrue( seems_utf8( $utf8_string ) );
     
    2929     */
    3030    function test_returns_false_for_non_utf8_strings( $big5_string ) {
    31         $this->markTestIncomplete( 'This test does not have any assertions.' );
    32 
    33         $big5 = $big5[0];
    34         $strings = array(
    35             "abc",
    36             "123",
    37             $big5
    38         );
     31        $this->assertFalse( seems_utf8( $big5_string ) );
    3932    }
    4033
    4134    function big5_strings() {
    4235        // Get data from formatting/big5.txt
    43         return array( array( 'incomplete' ) );
     36        $big5_strings = file( DIR_TESTDATA . '/formatting/big5.txt' );
     37        foreach ( $big5_strings as &$string ) {
     38            $string = (array) trim( $string );
     39        }
     40        unset( $string );
     41        return $big5_strings;
    4442    }
    4543}
Note: See TracChangeset for help on using the changeset viewer.