Make WordPress Core

Changeset 1170 in tests for trunk/tests/pomo/test_mo.php


Ignore:
Timestamp:
12/19/2012 12:56:28 AM (12 years ago)
Author:
SergeyBiryukov
Message:

Use DIR_TESTDATA in pomo tests. props mbijon. see #22989.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/pomo/test_mo.php

    r1106 r1170  
    55    function test_mo_simple() {
    66        $mo = new MO();
    7         $mo->import_from_file('data/pomo/simple.mo');
     7        $mo->import_from_file(DIR_TESTDATA . '/pomo/simple.mo');
    88        $this->assertEquals(array('Project-Id-Version' => 'WordPress 2.6-bleeding', 'Report-Msgid-Bugs-To' => 'wp-polyglots@lists.automattic.com'), $mo->headers);
    99        $this->assertEquals(2, count($mo->entries));
     
    1414    function test_mo_plural() {
    1515        $mo = new MO();
    16         $mo->import_from_file('data/pomo/plural.mo');
     16        $mo->import_from_file(DIR_TESTDATA . '/pomo/plural.mo');
    1717        $this->assertEquals(1, count($mo->entries));
    1818        $this->assertEquals(array("oney dragoney", "twoey dragoney", "manyey dragoney", "manyeyey dragoney", "manyeyeyey dragoney"), $mo->entries["one dragon"]->translations);
     
    4141    function test_mo_context() {
    4242        $mo = new MO();
    43         $mo->import_from_file('data/pomo/context.mo');
     43        $mo->import_from_file(DIR_TESTDATA . '/pomo/context.mo');
    4444        $this->assertEquals(2, count($mo->entries));
    4545        $plural_entry = new Translation_Entry(array('singular' => 'one dragon', 'plural' => '%d dragons', 'translations' => array("oney dragoney", "twoey dragoney","manyey dragoney"), 'context' => 'dragonland'));
     
    114114    function test_nplurals_with_backslashn() {
    115115        $mo = new MO();
    116         $mo->import_from_file('data/pomo/bad_nplurals.mo');
     116        $mo->import_from_file(DIR_TESTDATA . '/pomo/bad_nplurals.mo');
    117117        $this->assertEquals('%d foro', $mo->translate_plural('%d forum', '%d forums', 1));
    118118        $this->assertEquals('%d foros', $mo->translate_plural('%d forum', '%d forums', 2));
     
    123123        $start = microtime(true);
    124124        $mo = new MO();
    125         $mo->import_from_file('data/pomo/de_DE-2.8.mo');
     125        $mo->import_from_file(DIR_TESTDATA . '/pomo/de_DE-2.8.mo');
    126126        // echo "\nPerformance: ".(microtime(true) - $start)."\n";
    127127    }
     
    132132        if ((ini_get("mbstring.func_overload") & 2) != 0) {
    133133            $mo = new MO();
    134             $mo->import_from_file('data/pomo/overload.mo');
     134            $mo->import_from_file(DIR_TESTDATA . '/pomo/overload.mo');
    135135            $this->assertEquals(array('Табло'), $mo->entries['Dashboard']->translations);
    136136        }
     
    139139    function test_load_pot_file() {
    140140        $mo = new MO();
    141         $this->assertEquals( false, $mo->import_from_file('data/pomo/mo.pot') );
     141        $this->assertEquals( false, $mo->import_from_file(DIR_TESTDATA . '/pomo/mo.pot') );
    142142    }
    143143}
Note: See TracChangeset for help on using the changeset viewer.