Make WordPress Core

Changeset 25395


Ignore:
Timestamp:
09/12/2013 06:46:35 AM (11 years ago)
Author:
wonderboymusic
Message:

Suppress Non-static method PO::*() should not be called statically, assuming $this from incompatible context by using the @ silencer in tests/pomo/po.php

See #25282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/pomo/po.php

    r25002 r25395  
    3838
    3939    function test_prepend_each_line() {
    40         $this->assertEquals('baba_', PO::prepend_each_line('', 'baba_'));
    41         $this->assertEquals('baba_dyado', PO::prepend_each_line('dyado', 'baba_'));
    42         $this->assertEquals("# baba\n# dyado\n# \n", PO::prepend_each_line("baba\ndyado\n\n", '# '));
     40        $this->assertEquals('baba_', @PO::prepend_each_line('', 'baba_'));
     41        $this->assertEquals('baba_dyado', @PO::prepend_each_line('dyado', 'baba_'));
     42        $this->assertEquals("# baba\n# dyado\n# \n", @PO::prepend_each_line("baba\ndyado\n\n", '# '));
    4343    }
    4444
    4545    function test_poify() {
    4646        //simple
    47         $this->assertEquals('"baba"', PO::poify('baba'));
     47        $this->assertEquals('"baba"', @PO::poify('baba'));
    4848        //long word
    49         $this->assertEquals($this->po_a90, PO::poify($this->a90));
     49        $this->assertEquals($this->po_a90, @PO::poify($this->a90));
    5050        // tab
    51         $this->assertEquals('"ba\tba"', PO::poify("ba\tba"));
     51        $this->assertEquals('"ba\tba"', @PO::poify("ba\tba"));
    5252        // do not add leading empty string of one-line string ending on a newline
    53         $this->assertEquals('"\\\\a\\\\n\\n"', PO::poify("\a\\n\n"));
     53        $this->assertEquals('"\\\\a\\\\n\\n"', @PO::poify("\a\\n\n"));
    5454        // backslash
    55         $this->assertEquals('"ba\\\\ba"', PO::poify('ba\\ba'));
     55        $this->assertEquals('"ba\\\\ba"', @PO::poify('ba\\ba'));
    5656        // random wordpress.pot string
    5757        $src = 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.';
    58         $this->assertEquals("\"Categories can be selectively converted to tags using the <a href=\\\"%s\\\">category to tag converter</a>.\"", PO::poify($src));
    59 
    60         $this->assertEquals($this->po_mail, PO::poify($this->mail));
     58        $this->assertEquals("\"Categories can be selectively converted to tags using the <a href=\\\"%s\\\">category to tag converter</a>.\"", @PO::poify($src));
     59
     60        $this->assertEquals($this->po_mail, @PO::poify($this->mail));
    6161    }
    6262
    6363    function test_unpoify() {
    64         $this->assertEquals('baba', PO::unpoify('"baba"'));
    65         $this->assertEquals("baba\ngugu", PO::unpoify('"baba\n"'."\t\t\t\n".'"gugu"'));
    66         $this->assertEquals($this->a90, PO::unpoify($this->po_a90));
    67         $this->assertEquals('\\t\\n', PO::unpoify('"\\\\t\\\\n"'));
     64        $this->assertEquals('baba', @PO::unpoify('"baba"'));
     65        $this->assertEquals("baba\ngugu", @PO::unpoify('"baba\n"'."\t\t\t\n".'"gugu"'));
     66        $this->assertEquals($this->a90, @PO::unpoify($this->po_a90));
     67        $this->assertEquals('\\t\\n', @PO::unpoify('"\\\\t\\\\n"'));
    6868        // wordwrapped
    69         $this->assertEquals('babadyado', PO::unpoify("\"\"\n\"baba\"\n\"dyado\""));
    70         $this->assertEquals($this->mail, PO::unpoify($this->po_mail));
     69        $this->assertEquals('babadyado', @PO::unpoify("\"\"\n\"baba\"\n\"dyado\""));
     70        $this->assertEquals($this->mail, @PO::unpoify($this->po_mail));
    7171    }
    7272
    7373    function test_export_entry() {
    7474        $entry = new Translation_Entry(array('singular' => 'baba'));
    75         $this->assertEquals("msgid \"baba\"\nmsgstr \"\"", PO::export_entry($entry));
     75        $this->assertEquals("msgid \"baba\"\nmsgstr \"\"", @PO::export_entry($entry));
    7676        // plural
    7777        $entry = new Translation_Entry(array('singular' => 'baba', 'plural' => 'babas'));
     
    7979msgid_plural "babas"
    8080msgstr[0] ""
    81 msgstr[1] ""', PO::export_entry($entry));
     81msgstr[1] ""', @PO::export_entry($entry));
    8282        $entry = new Translation_Entry(array('singular' => 'baba', 'translator_comments' => "baba\ndyado"));
    8383        $this->assertEquals('#  baba
    8484#  dyado
    8585msgid "baba"
    86 msgstr ""', PO::export_entry($entry));
     86msgstr ""', @PO::export_entry($entry));
    8787        $entry = new Translation_Entry(array('singular' => 'baba', 'extracted_comments' => "baba"));
    8888        $this->assertEquals('#. baba
    8989msgid "baba"
    90 msgstr ""', PO::export_entry($entry));
     90msgstr ""', @PO::export_entry($entry));
    9191        $entry = new Translation_Entry(array(
    9292            'singular' => 'baba',
     
    9797#: 29
    9898msgid "baba"
    99 msgstr ""', PO::export_entry($entry));
     99msgstr ""', @PO::export_entry($entry));
    100100        $entry = new Translation_Entry(array('singular' => 'baba', 'translations' => array()));
    101         $this->assertEquals("msgid \"baba\"\nmsgstr \"\"", PO::export_entry($entry));
     101        $this->assertEquals("msgid \"baba\"\nmsgstr \"\"", @PO::export_entry($entry));
    102102
    103103        $entry = new Translation_Entry(array('singular' => 'baba', 'translations' => array('куку', 'буку')));
    104         $this->assertEquals("msgid \"baba\"\nmsgstr \"куку\"", PO::export_entry($entry));
     104        $this->assertEquals("msgid \"baba\"\nmsgstr \"куку\"", @PO::export_entry($entry));
    105105
    106106        $entry = new Translation_Entry(array('singular' => 'baba', 'plural' => 'babas', 'translations' => array('кукубуку')));
    107107        $this->assertEquals('msgid "baba"
    108108msgid_plural "babas"
    109 msgstr[0] "кукубуку"', PO::export_entry($entry));
     109msgstr[0] "кукубуку"', @PO::export_entry($entry));
    110110
    111111        $entry = new Translation_Entry(array('singular' => 'baba', 'plural' => 'babas', 'translations' => array('кукубуку', 'кукуруку', 'бабаяга')));
     
    114114msgstr[0] "кукубуку"
    115115msgstr[1] "кукуруку"
    116 msgstr[2] "бабаяга"', PO::export_entry($entry));
     116msgstr[2] "бабаяга"', @PO::export_entry($entry));
    117117        // context
    118118        $entry = new Translation_Entry(array('context' => 'ctxt', 'singular' => 'baba', 'plural' => 'babas', 'translations' => array('кукубуку', 'кукуруку', 'бабаяга'), 'flags' => array('fuzzy', 'php-format')));
     
    123123msgstr[0] "кукубуку"
    124124msgstr[1] "кукуруку"
    125 msgstr[2] "бабаяга"', PO::export_entry($entry));
     125msgstr[2] "бабаяга"', @PO::export_entry($entry));
    126126    }
    127127
Note: See TracChangeset for help on using the changeset viewer.