Make WordPress Core

Ticket #35284: 35284.patch

File 35284.patch, 2.8 KB (added by realloc, 9 years ago)

Tests for wp_get_pomo_file_data and modified simple.po

  • tests/phpunit/data/pomo/simple.po

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: WordPress 2.6-bleeding\n"
    4 "Plural-Forms: nplurals=2; plural=n != 1;\n"
     3"Project-Id-Version: WordPress Develop\n"
     4"POT-Creation-Date: 2016-01-02 08:16+0100\n"
     5"PO-Revision-Date: 2016-01-02 08:20+0100\n"
     6"X-Generator: Poedit 1.8.4\n"
     7"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     8"Last-Translator: \n"
     9"Language-Team: \n"
     10"MIME-Version: 1.0\n"
     11"Content-Type: text/plain; charset=iso-8859-1\n"
     12"Content-Transfer-Encoding: 8bit\n"
     13"Language: en\n"
    514
    615msgid "moon"
    716msgstr ""
     
    1120msgid_plural "struts"
    1221msgstr[0] "ztrut0"
    1322msgstr[1] "ztrut1"
    14 msgstr[2] "ztrut2"
    1523
    1624msgid ""
    1725"The first thing you need to do is tell Blogger to let WordPress access your "
    1826"account. You will be sent back here after providing authorization."
    19 msgstr "baba\n"
    20 "dyado"
    21 "gugu"
     27msgstr ""
     28"baba\n"
     29"dyadogugu"
    2230
    23 msgctxt ""
    24 "con"
    25 "text"
    26 msgid ""
    27 "sing"
    28 "ular"
    29 msgid_plural ""
    30 "plu"
    31 "ral"
    32 msgstr[0] ""
    33 "trans"
    34 "lation0"
    35 msgstr[1] ""
    36 "trans"
    37 "lation1"
    38 msgstr[2] ""
    39 "translation2"
     31msgctxt "context"
     32msgid "singular"
     33msgid_plural "plural"
     34msgstr[0] "translation0"
     35msgstr[1] "translation1"
    4036
    41 
    42 
    4337# baba
    44 #: wp-admin/x.php:111 baba:333
     38#       brubru
    4539#. translators: buuu
    46 #       brubru
    47 #, fuzzy
    48 #: baba
     40#: wp-admin/x.php:111 baba:333 baba
    4941msgid "a"
    5042msgstr ""
    5143
    5244msgid "a\""
    5345msgstr ""
    54 
  • tests/phpunit/tests/l10n.php

     
    2626                $this->assertEquals( 'first-before-bar|second-before-bar', before_last_bar( 'first-before-bar|second-before-bar|after-last-bar' ) );
    2727        }
    2828
     29        /**
     30         * @ticket 35284
     31         */
     32        function test_wp_get_pomo_file_data() {
     33                $file = DIR_TESTDATA . '/pomo/empty.po';
     34                $array = wp_get_pomo_file_data( $file );
     35                $this->assertArrayHasKey( 'POT-Creation-Date', $array );
     36                $this->assertArrayHasKey( 'PO-Revision-Date', $array );
     37                $this->assertArrayHasKey( 'Project-Id-Version', $array );
     38                $this->assertArrayHasKey( 'X-Generator', $array );
     39
     40                $file = DIR_TESTDATA . '/pomo/simple.po';
     41                $array = wp_get_pomo_file_data( $file );
     42                $this->assertNotEmpty( $array['POT-Creation-Date'] );
     43                $this->assertNotEmpty( $array['PO-Revision-Date'] );
     44                $this->assertEquals( 'WordPress Develop', $array['Project-Id-Version'] );
     45                $this->assertNotEmpty( $array['X-Generator'] );
     46        }
     47
    2948}