WordPress.org

Make WordPress Core

Changeset 30525


Ignore:
Timestamp:
11/22/2014 08:56:23 PM (6 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.

Location:
trunk/tests/phpunit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/data/formatting/big5.txt

    r25002 r30525  
    1 ?lmDwgn H@~|Q
    2 
    3 ?lDg
    4 
    5 H@
    6 
    7 DiDAD`DCWiWAD`WCLAW?alQAWUC
    8 G`LAH[?F`AH[uC?APX?WAP?
    9 ?C?S?AC
    10 
    11 HG
    12 
    13 ?U?AcoQ?AoCGL??A
    14 ?Au??AU?gAn?MAeHCOHtHBuL
    15 voAuv?CU@j?A??A?A\
    16 ?~C??~AOHhC
    17 
    18 HT
    19 
    20 |A?QQofA?sQiA??
    21 COHutHvvA?A?Az?Aj?C`?LL
    22 C???]CuLvAhLvC
    23 
    24 h|
    25 
    26 uDvRA????CWAUvQUA?gAM
    27 AP?Q?FsC^?lHH?C
    28 
    29 H
    30 
    31 ?aAHU?QtHAH?m?C?aAS
    32 GH?}A??UXCh?aApuC
    33 
    34 H
    35 
    36 AO??gC??AO??a?CYsA??C
    37 
    38 HC
    39 
    40 ?a[C?a?HB[?AH???AG[COHtH
    41 ?A~??sCDHLpHG?pC
    42 
    43 HK
    44 
    45 WYCQU?CBH?cAGXDC~aA?
    46 WAPAHAFvA?A?gC??AGL?C
    47 
    48 HE
    49 
    50 ??ApwQ?UAiOC?AuQIQ
    51 zA?SC\EhA?DC
     1ª©¥»
     2¤ÀÃþ
     3Àô¹Ò
     4©Ê½è
     5­º­¶
  • 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.