Changeset 1170 in tests
- Timestamp:
- 12/19/2012 12:56:28 AM (12 years ago)
- Location:
- trunk/tests/pomo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/pomo/test_mo.php
r1106 r1170 5 5 function test_mo_simple() { 6 6 $mo = new MO(); 7 $mo->import_from_file( 'data/pomo/simple.mo');7 $mo->import_from_file(DIR_TESTDATA . '/pomo/simple.mo'); 8 8 $this->assertEquals(array('Project-Id-Version' => 'WordPress 2.6-bleeding', 'Report-Msgid-Bugs-To' => 'wp-polyglots@lists.automattic.com'), $mo->headers); 9 9 $this->assertEquals(2, count($mo->entries)); … … 14 14 function test_mo_plural() { 15 15 $mo = new MO(); 16 $mo->import_from_file( 'data/pomo/plural.mo');16 $mo->import_from_file(DIR_TESTDATA . '/pomo/plural.mo'); 17 17 $this->assertEquals(1, count($mo->entries)); 18 18 $this->assertEquals(array("oney dragoney", "twoey dragoney", "manyey dragoney", "manyeyey dragoney", "manyeyeyey dragoney"), $mo->entries["one dragon"]->translations); … … 41 41 function test_mo_context() { 42 42 $mo = new MO(); 43 $mo->import_from_file( 'data/pomo/context.mo');43 $mo->import_from_file(DIR_TESTDATA . '/pomo/context.mo'); 44 44 $this->assertEquals(2, count($mo->entries)); 45 45 $plural_entry = new Translation_Entry(array('singular' => 'one dragon', 'plural' => '%d dragons', 'translations' => array("oney dragoney", "twoey dragoney","manyey dragoney"), 'context' => 'dragonland')); … … 114 114 function test_nplurals_with_backslashn() { 115 115 $mo = new MO(); 116 $mo->import_from_file( 'data/pomo/bad_nplurals.mo');116 $mo->import_from_file(DIR_TESTDATA . '/pomo/bad_nplurals.mo'); 117 117 $this->assertEquals('%d foro', $mo->translate_plural('%d forum', '%d forums', 1)); 118 118 $this->assertEquals('%d foros', $mo->translate_plural('%d forum', '%d forums', 2)); … … 123 123 $start = microtime(true); 124 124 $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'); 126 126 // echo "\nPerformance: ".(microtime(true) - $start)."\n"; 127 127 } … … 132 132 if ((ini_get("mbstring.func_overload") & 2) != 0) { 133 133 $mo = new MO(); 134 $mo->import_from_file( 'data/pomo/overload.mo');134 $mo->import_from_file(DIR_TESTDATA . '/pomo/overload.mo'); 135 135 $this->assertEquals(array('Табло'), $mo->entries['Dashboard']->translations); 136 136 } … … 139 139 function test_load_pot_file() { 140 140 $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') ); 142 142 } 143 143 } -
trunk/tests/pomo/test_po.php
r1106 r1170 175 175 function test_import_from_file() { 176 176 $po = new PO(); 177 $res = $po->import_from_file( 'data/pomo/simple.po');177 $res = $po->import_from_file(DIR_TESTDATA . '/pomo/simple.po'); 178 178 $this->assertEquals(true, $res); 179 179 … … 205 205 function test_import_from_entry_file_should_give_false() { 206 206 $po = new PO(); 207 $this->assertFalse( $po->import_from_file( 'data/pomo/empty.po' ) );207 $this->assertFalse( $po->import_from_file( DIR_TESTDATA . '/pomo/empty.po' ) ); 208 208 } 209 209 210 210 function test_import_from_file_with_windows_line_endings_should_work_as_with_unix_line_endings() { 211 211 $po = new PO(); 212 $this->assertTrue( $po->import_from_file( 'data/pomo/windows-line-endings.po' ) );212 $this->assertTrue( $po->import_from_file( DIR_TESTDATA . '/pomo/windows-line-endings.po' ) ); 213 213 $this->assertEquals( 1, count( $po->entries ) ); 214 214 }
Note: See TracChangeset
for help on using the changeset viewer.