<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Tests][1171] trunk/tests/pomo: Rename pomo tests to conform to the standard introduced in [904].</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/1171/tests">1171</a></dd>
<dt>Author</dt> <dd>SergeyBiryukov</dd>
<dt>Date</dt> <dd>2012-12-19 01:28:04 +0000 (Wed, 19 Dec 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename pomo tests to conform to the standard introduced in <a href="http://core.trac.wordpress.org/changeset/904/tests">[904]</a>. see <a href="http://core.trac.wordpress.org/changeset/1106/tests">[1106]</a>.</pre>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunktestspomomophp">trunk/tests/pomo/mo.php</a></li>
<li><a href="#trunktestspomonoopTranslationsphp">trunk/tests/pomo/noopTranslations.php</a></li>
<li><a href="#trunktestspomopophp">trunk/tests/pomo/po.php</a></li>
<li><a href="#trunktestspomotranslationEntryphp">trunk/tests/pomo/translationEntry.php</a></li>
<li><a href="#trunktestspomotranslationsphp">trunk/tests/pomo/translations.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunktestspomotest_mophp">trunk/tests/pomo/test_mo.php</a></li>
<li><a href="#trunktestspomotest_noop_translationsphp">trunk/tests/pomo/test_noop_translations.php</a></li>
<li><a href="#trunktestspomotest_pophp">trunk/tests/pomo/test_po.php</a></li>
<li><a href="#trunktestspomotest_translation_entryphp">trunk/tests/pomo/test_translation_entry.php</a></li>
<li><a href="#trunktestspomotest_translationsphp">trunk/tests/pomo/test_translations.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestspomomophpfromrev1170trunktestspomotest_mophp"></a>
<div class="copfile"><h4>Copied: trunk/tests/pomo/mo.php (from rev 1170, trunk/tests/pomo/test_mo.php) (0 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/mo.php                                (rev 0)
+++ trunk/tests/pomo/mo.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -0,0 +1,143 @@
</span><ins>+&lt;?php
+
+class Tests_POMO_MO extends WP_UnitTestCase {
+
+        function test_mo_simple() {
+                $mo = new MO();
+                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/simple.mo');
+                $this-&gt;assertEquals(array('Project-Id-Version' =&gt; 'WordPress 2.6-bleeding', 'Report-Msgid-Bugs-To' =&gt; 'wp-polyglots@lists.automattic.com'), $mo-&gt;headers);
+                $this-&gt;assertEquals(2, count($mo-&gt;entries));
+                $this-&gt;assertEquals(array('dyado'), $mo-&gt;entries['baba']-&gt;translations);
+                $this-&gt;assertEquals(array('yes'), $mo-&gt;entries[&quot;kuku\nruku&quot;]-&gt;translations);
+        }
+
+        function test_mo_plural() {
+                $mo = new MO();
+                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/plural.mo');
+                $this-&gt;assertEquals(1, count($mo-&gt;entries));
+                $this-&gt;assertEquals(array(&quot;oney dragoney&quot;, &quot;twoey dragoney&quot;, &quot;manyey dragoney&quot;, &quot;manyeyey dragoney&quot;, &quot;manyeyeyey dragoney&quot;), $mo-&gt;entries[&quot;one dragon&quot;]-&gt;translations);
+
+                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 1));
+                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 2));
+                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', -8));
+
+
+                $mo-&gt;set_header('Plural-Forms', 'nplurals=5; plural=0');
+                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 1));
+                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 2));
+                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', -8));
+
+                $mo-&gt;set_header('Plural-Forms', 'nplurals=5; plural=n%10==1 &amp;&amp; n%100!=11 ? 0 : n%10&gt;=2 &amp;&amp; n%10&lt;=4 &amp;&amp; (n%100&lt;10 || n%100&gt;=20) ? 1 : 2;');
+                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 1));
+                $this-&gt;assertEquals('manyey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 11));
+                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 3));
+
+                $mo-&gt;set_header('Plural-Forms', 'nplurals=2; plural=n !=1;');
+                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 1));
+                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 2));
+                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', -8));
+        }
+
+        function test_mo_context() {
+                $mo = new MO();
+                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/context.mo');
+                $this-&gt;assertEquals(2, count($mo-&gt;entries));
+                $plural_entry = new Translation_Entry(array('singular' =&gt; 'one dragon', 'plural' =&gt; '%d dragons', 'translations' =&gt; array(&quot;oney dragoney&quot;, &quot;twoey dragoney&quot;,&quot;manyey dragoney&quot;), 'context' =&gt; 'dragonland'));
+                $this-&gt;assertEquals($plural_entry, $mo-&gt;entries[$plural_entry-&gt;key()]);
+                $this-&gt;assertEquals(&quot;dragonland&quot;, $mo-&gt;entries[$plural_entry-&gt;key()]-&gt;context);
+
+                $single_entry = new Translation_Entry(array('singular' =&gt; 'one dragon', 'translations' =&gt; array(&quot;oney dragoney&quot;), 'context' =&gt; 'not so dragon'));
+                $this-&gt;assertEquals($single_entry, $mo-&gt;entries[$single_entry-&gt;key()]);
+                $this-&gt;assertEquals(&quot;not so dragon&quot;, $mo-&gt;entries[$single_entry-&gt;key()]-&gt;context);
+
+        }
+
+        function test_translations_merge() {
+                $host = new Translations();
+                $host-&gt;add_entry(new Translation_Entry(array('singular' =&gt; 'pink',)));
+                $host-&gt;add_entry(new Translation_Entry(array('singular' =&gt; 'green',)));
+                $guest = new Translations();
+                $guest-&gt;add_entry(new Translation_Entry(array('singular' =&gt; 'green',)));
+                $guest-&gt;add_entry(new Translation_Entry(array('singular' =&gt; 'red',)));
+                $host-&gt;merge_with($guest);
+                $this-&gt;assertEquals(3, count($host-&gt;entries));
+                $this-&gt;assertEquals(array(), array_diff(array('pink', 'green', 'red'), array_keys($host-&gt;entries)));
+        }
+
+        function test_export_mo_file() {
+                $entries = array();
+                $entries[] = new Translation_Entry(array('singular' =&gt; 'pink',
+                        'translations' =&gt; array('розов')));
+                $no_translation_entry = new Translation_Entry(array('singular' =&gt; 'grey'));
+                $entries[] = new Translation_Entry(array('singular' =&gt; 'green', 'plural' =&gt; 'greens',
+                        'translations' =&gt; array('зелен', 'зелени')));
+                $entries[] = new Translation_Entry(array('singular' =&gt; 'red', 'context' =&gt; 'color',
+                        'translations' =&gt; array('червен')));
+                $entries[] = new Translation_Entry(array('singular' =&gt; 'red', 'context' =&gt; 'bull',
+                        'translations' =&gt; array('бик')));
+                $entries[] = new Translation_Entry(array('singular' =&gt; 'maroon', 'plural' =&gt; 'maroons', 'context' =&gt; 'context',
+                        'translations' =&gt; array('пурпурен', 'пурпурни')));
+
+                $mo = new MO();
+                $mo-&gt;set_header('Project-Id-Version', 'Baba Project 1.0');
+                foreach($entries as $entry) {
+                        $mo-&gt;add_entry($entry);
+                }
+                $mo-&gt;add_entry($no_translation_entry);
+
+                $temp_fn = $this-&gt;temp_filename();
+                $mo-&gt;export_to_file($temp_fn);
+
+                $again = new MO();
+                $again-&gt;import_from_file($temp_fn);
+
+                $this-&gt;assertEquals(count($entries), count($again-&gt;entries));
+                foreach($entries as $entry) {
+                        $this-&gt;assertEquals($entry, $again-&gt;entries[$entry-&gt;key()]);
+                }
+        }
+
+        function test_export_should_not_include_empty_translations() {
+                $entries = array(  );
+                $mo = new MO;
+                $mo-&gt;add_entry( array( 'singular' =&gt; 'baba', 'translations' =&gt; array( '', '' ) ) );
+
+                $temp_fn = $this-&gt;temp_filename();
+                $mo-&gt;export_to_file( $temp_fn );
+
+                $again = new MO();
+                $again-&gt;import_from_file($temp_fn);
+
+                $this-&gt;assertEquals( 0, count( $again-&gt;entries ) );
+        }
+
+        function test_nplurals_with_backslashn() {
+                $mo = new MO();
+                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/bad_nplurals.mo');
+                $this-&gt;assertEquals('%d foro', $mo-&gt;translate_plural('%d forum', '%d forums', 1));
+                $this-&gt;assertEquals('%d foros', $mo-&gt;translate_plural('%d forum', '%d forums', 2));
+                $this-&gt;assertEquals('%d foros', $mo-&gt;translate_plural('%d forum', '%d forums', -1));
+        }
+
+        function disabled_test_performance() {
+                $start = microtime(true);
+                $mo = new MO();
+                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/de_DE-2.8.mo');
+                // echo &quot;\nPerformance: &quot;.(microtime(true) - $start).&quot;\n&quot;;
+        }
+
+        function test_overloaded_mb_functions() {
+                // skipIf() method skips the whole test case, not only this method
+                // that's why we are skipping it the stupid way
+                if ((ini_get(&quot;mbstring.func_overload&quot;) &amp; 2) != 0) {
+                        $mo = new MO();
+                        $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/overload.mo');
+                        $this-&gt;assertEquals(array('Табло'), $mo-&gt;entries['Dashboard']-&gt;translations);
+                }
+        }
+
+        function test_load_pot_file() {
+                $mo = new MO();
+                $this-&gt;assertEquals( false, $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/mo.pot') );
+        }
+}
</ins></span></pre></div>
<a id="trunktestspomonoopTranslationsphpfromrev1169trunktestspomotest_noop_translationsphp"></a>
<div class="copfile"><h4>Copied: trunk/tests/pomo/noopTranslations.php (from rev 1169, trunk/tests/pomo/test_noop_translations.php) (0 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/noopTranslations.php                                (rev 0)
+++ trunk/tests/pomo/noopTranslations.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+&lt;?php
+
+class Tests_POMO_NOOPTranslations extends WP_UnitTestCase {
+        function setUp() {
+                parent::setUp();
+                $this-&gt;noop = new NOOP_Translations;
+                $this-&gt;entry = new Translation_Entry( array( 'singular' =&gt; 'baba' ) );
+                $this-&gt;plural_entry = new Translation_Entry(array('singular' =&gt; 'dyado', 'plural' =&gt; 'dyados', 'translations' =&gt; array('dyadox', 'dyadoy')));
+        }
+
+        function test_get_header() {
+                $this-&gt;assertEquals( false, $this-&gt;noop-&gt;get_header( 'Content-Type' ) );
+        }
+
+        function test_add_entry() {
+                $this-&gt;noop-&gt;add_entry( $this-&gt;entry );
+                $this-&gt;assertEquals( array(), $this-&gt;noop-&gt;entries );
+        }
+
+        function test_set_header() {
+                $this-&gt;noop-&gt;set_header( 'header', 'value' );
+                $this-&gt;assertEquals( array(), $this-&gt;noop-&gt;headers );
+        }
+
+        function test_translate_entry() {
+                $this-&gt;noop-&gt;add_entry( $this-&gt;entry );
+                $this-&gt;assertEquals( false, $this-&gt;noop-&gt;translate_entry( $this-&gt;entry ) );
+        }
+
+        function test_translate() {
+                $this-&gt;noop-&gt;add_entry( $this-&gt;entry );
+                $this-&gt;assertEquals( 'baba', $this-&gt;noop-&gt;translate( 'baba' ) );
+        }
+
+        function test_plural() {
+                $this-&gt;noop-&gt;add_entry( $this-&gt;plural_entry );
+                $this-&gt;assertEquals( 'dyado', $this-&gt;noop-&gt;translate_plural( 'dyado', 'dyados', 1 ) );
+                $this-&gt;assertEquals( 'dyados', $this-&gt;noop-&gt;translate_plural( 'dyado', 'dyados', 11 ) );
+                $this-&gt;assertEquals( 'dyados', $this-&gt;noop-&gt;translate_plural( 'dyado', 'dyados', 0 ) );
+        }
+}
</ins></span></pre></div>
<a id="trunktestspomopophpfromrev1170trunktestspomotest_pophp"></a>
<div class="copfile"><h4>Copied: trunk/tests/pomo/po.php (from rev 1170, trunk/tests/pomo/test_po.php) (0 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/po.php                                (rev 0)
+++ trunk/tests/pomo/po.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -0,0 +1,218 @@
</span><ins>+&lt;?php
+
+class Tests_POMO_PO extends WP_UnitTestCase {
+        function setUp() {
+                require_once ABSPATH . '/wp-includes/pomo/po.php';
+                // not so random wordpress.pot string -- multiple lines
+                $this-&gt;mail = &quot;Your new WordPress blog has been successfully set up at:
+
+%1\$s
+
+You can log in to the administrator account with the following information:
+
+Username: %2\$s
+Password: %3\$s
+
+We hope you enjoy your new blog. Thanks!
+
+--The WordPress Team
+http://wordpress.org/
+&quot;;
+        $this-&gt;po_mail = '&quot;&quot;
+&quot;Your new WordPress blog has been successfully set up at:\n&quot;
+&quot;\n&quot;
+&quot;%1$s\n&quot;
+&quot;\n&quot;
+&quot;You can log in to the administrator account with the following information:\n&quot;
+&quot;\n&quot;
+&quot;Username: %2$s\n&quot;
+&quot;Password: %3$s\n&quot;
+&quot;\n&quot;
+&quot;We hope you enjoy your new blog. Thanks!\n&quot;
+&quot;\n&quot;
+&quot;--The WordPress Team\n&quot;
+&quot;http://wordpress.org/\n&quot;';
+                $this-&gt;a90 = str_repeat(&quot;a&quot;, 90);
+                $this-&gt;po_a90 = &quot;\&quot;$this-&gt;a90\&quot;&quot;;
+    }
+
+        function test_prepend_each_line() {
+                $this-&gt;assertEquals('baba_', PO::prepend_each_line('', 'baba_'));
+                $this-&gt;assertEquals('baba_dyado', PO::prepend_each_line('dyado', 'baba_'));
+                $this-&gt;assertEquals(&quot;# baba\n# dyado\n# \n&quot;, PO::prepend_each_line(&quot;baba\ndyado\n\n&quot;, '# '));
+        }
+
+        function test_poify() {
+                //simple
+                $this-&gt;assertEquals('&quot;baba&quot;', PO::poify('baba'));
+                //long word
+                $this-&gt;assertEquals($this-&gt;po_a90, PO::poify($this-&gt;a90));
+                // tab
+                $this-&gt;assertEquals('&quot;ba\tba&quot;', PO::poify(&quot;ba\tba&quot;));
+                // do not add leading empty string of one-line string ending on a newline
+                $this-&gt;assertEquals('&quot;\\\\a\\\\n\\n&quot;', PO::poify(&quot;\a\\n\n&quot;));
+                // backslash
+                $this-&gt;assertEquals('&quot;ba\\\\ba&quot;', PO::poify('ba\\ba'));
+                // random wordpress.pot string
+                $src = 'Categories can be selectively converted to tags using the &lt;a href=&quot;%s&quot;&gt;category to tag converter&lt;/a&gt;.';
+                $this-&gt;assertEquals(&quot;\&quot;Categories can be selectively converted to tags using the &lt;a href=\\\&quot;%s\\\&quot;&gt;category to tag converter&lt;/a&gt;.\&quot;&quot;, PO::poify($src));
+
+                $this-&gt;assertEquals($this-&gt;po_mail, PO::poify($this-&gt;mail));
+        }
+
+        function test_unpoify() {
+                $this-&gt;assertEquals('baba', PO::unpoify('&quot;baba&quot;'));
+                $this-&gt;assertEquals(&quot;baba\ngugu&quot;, PO::unpoify('&quot;baba\n&quot;'.&quot;\t\t\t\n&quot;.'&quot;gugu&quot;'));
+                $this-&gt;assertEquals($this-&gt;a90, PO::unpoify($this-&gt;po_a90));
+                $this-&gt;assertEquals('\\t\\n', PO::unpoify('&quot;\\\\t\\\\n&quot;'));
+                // wordwrapped
+                $this-&gt;assertEquals('babadyado', PO::unpoify(&quot;\&quot;\&quot;\n\&quot;baba\&quot;\n\&quot;dyado\&quot;&quot;));
+                $this-&gt;assertEquals($this-&gt;mail, PO::unpoify($this-&gt;po_mail));
+        }
+
+        function test_export_entry() {
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba'));
+                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;&quot;, PO::export_entry($entry));
+                // plural
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas'));
+                $this-&gt;assertEquals('msgid &quot;baba&quot;
+msgid_plural &quot;babas&quot;
+msgstr[0] &quot;&quot;
+msgstr[1] &quot;&quot;', PO::export_entry($entry));
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'translator_comments' =&gt; &quot;baba\ndyado&quot;));
+                $this-&gt;assertEquals('#  baba
+#  dyado
+msgid &quot;baba&quot;
+msgstr &quot;&quot;', PO::export_entry($entry));
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'extracted_comments' =&gt; &quot;baba&quot;));
+                $this-&gt;assertEquals('#. baba
+msgid &quot;baba&quot;
+msgstr &quot;&quot;', PO::export_entry($entry));
+                $entry = new Translation_Entry(array(
+                        'singular' =&gt; 'baba',
+                        'extracted_comments' =&gt; &quot;baba&quot;,
+                        'references' =&gt; range(1, 29)));
+                $this-&gt;assertEquals('#. baba
+#: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
+#: 29
+msgid &quot;baba&quot;
+msgstr &quot;&quot;', PO::export_entry($entry));
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'translations' =&gt; array()));
+                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;&quot;, PO::export_entry($entry));
+
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'translations' =&gt; array('куку', 'буку')));
+                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;куку\&quot;&quot;, PO::export_entry($entry));
+
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas', 'translations' =&gt; array('кукубуку')));
+                $this-&gt;assertEquals('msgid &quot;baba&quot;
+msgid_plural &quot;babas&quot;
+msgstr[0] &quot;кукубуку&quot;', PO::export_entry($entry));
+
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas', 'translations' =&gt; array('кукубуку', 'кукуруку', 'бабаяга')));
+                $this-&gt;assertEquals('msgid &quot;baba&quot;
+msgid_plural &quot;babas&quot;
+msgstr[0] &quot;кукубуку&quot;
+msgstr[1] &quot;кукуруку&quot;
+msgstr[2] &quot;бабаяга&quot;', PO::export_entry($entry));
+                // context
+                $entry = new Translation_Entry(array('context' =&gt; 'ctxt', 'singular' =&gt; 'baba', 'plural' =&gt; 'babas', 'translations' =&gt; array('кукубуку', 'кукуруку', 'бабаяга'), 'flags' =&gt; array('fuzzy', 'php-format')));
+                $this-&gt;assertEquals('#, fuzzy, php-format
+msgctxt &quot;ctxt&quot;
+msgid &quot;baba&quot;
+msgid_plural &quot;babas&quot;
+msgstr[0] &quot;кукубуку&quot;
+msgstr[1] &quot;кукуруку&quot;
+msgstr[2] &quot;бабаяга&quot;', PO::export_entry($entry));
+    }
+
+        function test_export_entries() {
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba',));
+                $entry2 = new Translation_Entry(array('singular' =&gt; 'dyado',));
+                $po = new PO();
+                $po-&gt;add_entry($entry);
+                $po-&gt;add_entry($entry2);
+                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;\n\nmsgid \&quot;dyado\&quot;\nmsgstr \&quot;\&quot;&quot;, $po-&gt;export_entries());
+        }
+
+        function test_export_headers() {
+                $po = new PO();
+                $po-&gt;set_header('Project-Id-Version', 'WordPress 2.6-bleeding');
+                $po-&gt;set_header('POT-Creation-Date', '2008-04-08 18:00+0000');
+                $this-&gt;assertEquals(&quot;msgid \&quot;\&quot;\nmsgstr \&quot;\&quot;\n\&quot;Project-Id-Version: WordPress 2.6-bleeding\\n\&quot;\n\&quot;POT-Creation-Date: 2008-04-08 18:00+0000\\n\&quot;&quot;, $po-&gt;export_headers());
+        }
+
+        function test_export() {
+                $po = new PO();
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba',));
+                $entry2 = new Translation_Entry(array('singular' =&gt; 'dyado',));
+                $po-&gt;set_header('Project-Id-Version', 'WordPress 2.6-bleeding');
+                $po-&gt;set_header('POT-Creation-Date', '2008-04-08 18:00+0000');
+                $po-&gt;add_entry($entry);
+                $po-&gt;add_entry($entry2);
+                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;\n\nmsgid \&quot;dyado\&quot;\nmsgstr \&quot;\&quot;&quot;, $po-&gt;export(false));
+                $this-&gt;assertEquals(&quot;msgid \&quot;\&quot;\nmsgstr \&quot;\&quot;\n\&quot;Project-Id-Version: WordPress 2.6-bleeding\\n\&quot;\n\&quot;POT-Creation-Date: 2008-04-08 18:00+0000\\n\&quot;\n\nmsgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;\n\nmsgid \&quot;dyado\&quot;\nmsgstr \&quot;\&quot;&quot;, $po-&gt;export());
+        }
+
+
+        function test_export_to_file() {
+                $po = new PO();
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba',));
+                $entry2 = new Translation_Entry(array('singular' =&gt; 'dyado',));
+                $po-&gt;set_header('Project-Id-Version', 'WordPress 2.6-bleeding');
+                $po-&gt;set_header('POT-Creation-Date', '2008-04-08 18:00+0000');
+                $po-&gt;add_entry($entry);
+                $po-&gt;add_entry($entry2);
+
+                $temp_fn = $this-&gt;temp_filename();
+                $po-&gt;export_to_file($temp_fn, false);
+                $this-&gt;assertEquals($po-&gt;export(false), file_get_contents($temp_fn));
+
+                $temp_fn2 = $this-&gt;temp_filename();
+                $po-&gt;export_to_file($temp_fn2);
+                $this-&gt;assertEquals($po-&gt;export(), file_get_contents($temp_fn2));
+        }
+
+        function test_import_from_file() {
+                $po = new PO();
+                $res = $po-&gt;import_from_file(DIR_TESTDATA . '/pomo/simple.po');
+                $this-&gt;assertEquals(true, $res);
+
+                $this-&gt;assertEquals(array('Project-Id-Version' =&gt; 'WordPress 2.6-bleeding', 'Plural-Forms' =&gt; 'nplurals=2; plural=n != 1;'), $po-&gt;headers);
+
+                $simple_entry = new Translation_Entry(array('singular' =&gt; 'moon',));
+                $this-&gt;assertEquals($simple_entry, $po-&gt;entries[$simple_entry-&gt;key()]);
+
+                $all_types_entry = new Translation_Entry(array('singular' =&gt; 'strut', 'plural' =&gt; 'struts', 'context' =&gt; 'brum',
+                        'translations' =&gt; array('ztrut0', 'ztrut1', 'ztrut2')));
+                $this-&gt;assertEquals($all_types_entry, $po-&gt;entries[$all_types_entry-&gt;key()]);
+
+                $multiple_line_entry = new Translation_Entry(array('singular' =&gt; 'The first thing you need to do is tell Blogger to let WordPress access your account. You will be sent back here after providing authorization.', 'translations' =&gt; array(&quot;baba\ndyadogugu&quot;)));
+                $this-&gt;assertEquals($multiple_line_entry, $po-&gt;entries[$multiple_line_entry-&gt;key()]);
+
+                $multiple_line_all_types_entry = new Translation_Entry(array('context' =&gt; 'context', 'singular' =&gt; 'singular',
+                        'plural' =&gt; 'plural', 'translations' =&gt; array('translation0', 'translation1', 'translation2')));
+                $this-&gt;assertEquals($multiple_line_all_types_entry, $po-&gt;entries[$multiple_line_all_types_entry-&gt;key()]);
+
+                $comments_entry = new Translation_Entry(array('singular' =&gt; 'a', 'translator_comments' =&gt; &quot;baba\nbrubru&quot;,
+                        'references' =&gt; array('wp-admin/x.php:111', 'baba:333', 'baba'), 'extracted_comments' =&gt; &quot;translators: buuu&quot;,
+                        'flags' =&gt; array('fuzzy')));
+                $this-&gt;assertEquals($comments_entry, $po-&gt;entries[$comments_entry-&gt;key()]);
+
+                $end_quote_entry = new Translation_Entry(array('singular' =&gt; 'a&quot;'));
+                $this-&gt;assertEquals($end_quote_entry, $po-&gt;entries[$end_quote_entry-&gt;key()]);
+        }
+
+        function test_import_from_entry_file_should_give_false() {
+                $po = new PO();
+                $this-&gt;assertFalse( $po-&gt;import_from_file( DIR_TESTDATA . '/pomo/empty.po' ) );
+        }
+
+        function test_import_from_file_with_windows_line_endings_should_work_as_with_unix_line_endings() {
+                $po = new PO();
+                $this-&gt;assertTrue( $po-&gt;import_from_file( DIR_TESTDATA . '/pomo/windows-line-endings.po' ) );
+                $this-&gt;assertEquals( 1, count( $po-&gt;entries ) );
+        }
+
+        //TODO: add tests for bad files
+}
+?&gt;
</ins></span></pre></div>
<a id="trunktestspomotest_mophp"></a>
<div class="delfile"><h4>Deleted: trunk/tests/pomo/test_mo.php (1170 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/test_mo.php        2012-12-19 00:56:28 UTC (rev 1170)
+++ trunk/tests/pomo/test_mo.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -1,143 +0,0 @@
</span><del>-&lt;?php
-
-class WP_Test_MO extends WP_UnitTestCase {
-
-        function test_mo_simple() {
-                $mo = new MO();
-                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/simple.mo');
-                $this-&gt;assertEquals(array('Project-Id-Version' =&gt; 'WordPress 2.6-bleeding', 'Report-Msgid-Bugs-To' =&gt; 'wp-polyglots@lists.automattic.com'), $mo-&gt;headers);
-                $this-&gt;assertEquals(2, count($mo-&gt;entries));
-                $this-&gt;assertEquals(array('dyado'), $mo-&gt;entries['baba']-&gt;translations);
-                $this-&gt;assertEquals(array('yes'), $mo-&gt;entries[&quot;kuku\nruku&quot;]-&gt;translations);
-        }
-
-        function test_mo_plural() {
-                $mo = new MO();
-                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/plural.mo');
-                $this-&gt;assertEquals(1, count($mo-&gt;entries));
-                $this-&gt;assertEquals(array(&quot;oney dragoney&quot;, &quot;twoey dragoney&quot;, &quot;manyey dragoney&quot;, &quot;manyeyey dragoney&quot;, &quot;manyeyeyey dragoney&quot;), $mo-&gt;entries[&quot;one dragon&quot;]-&gt;translations);
-
-                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 1));
-                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 2));
-                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', -8));
-
-
-                $mo-&gt;set_header('Plural-Forms', 'nplurals=5; plural=0');
-                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 1));
-                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 2));
-                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', -8));
-
-                $mo-&gt;set_header('Plural-Forms', 'nplurals=5; plural=n%10==1 &amp;&amp; n%100!=11 ? 0 : n%10&gt;=2 &amp;&amp; n%10&lt;=4 &amp;&amp; (n%100&lt;10 || n%100&gt;=20) ? 1 : 2;');
-                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 1));
-                $this-&gt;assertEquals('manyey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 11));
-                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 3));
-
-                $mo-&gt;set_header('Plural-Forms', 'nplurals=2; plural=n !=1;');
-                $this-&gt;assertEquals('oney dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 1));
-                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', 2));
-                $this-&gt;assertEquals('twoey dragoney', $mo-&gt;translate_plural('one dragon', '%d dragons', -8));
-        }
-
-        function test_mo_context() {
-                $mo = new MO();
-                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/context.mo');
-                $this-&gt;assertEquals(2, count($mo-&gt;entries));
-                $plural_entry = new Translation_Entry(array('singular' =&gt; 'one dragon', 'plural' =&gt; '%d dragons', 'translations' =&gt; array(&quot;oney dragoney&quot;, &quot;twoey dragoney&quot;,&quot;manyey dragoney&quot;), 'context' =&gt; 'dragonland'));
-                $this-&gt;assertEquals($plural_entry, $mo-&gt;entries[$plural_entry-&gt;key()]);
-                $this-&gt;assertEquals(&quot;dragonland&quot;, $mo-&gt;entries[$plural_entry-&gt;key()]-&gt;context);
-
-                $single_entry = new Translation_Entry(array('singular' =&gt; 'one dragon', 'translations' =&gt; array(&quot;oney dragoney&quot;), 'context' =&gt; 'not so dragon'));
-                $this-&gt;assertEquals($single_entry, $mo-&gt;entries[$single_entry-&gt;key()]);
-                $this-&gt;assertEquals(&quot;not so dragon&quot;, $mo-&gt;entries[$single_entry-&gt;key()]-&gt;context);
-
-        }
-
-        function test_translations_merge() {
-                $host = new Translations();
-                $host-&gt;add_entry(new Translation_Entry(array('singular' =&gt; 'pink',)));
-                $host-&gt;add_entry(new Translation_Entry(array('singular' =&gt; 'green',)));
-                $guest = new Translations();
-                $guest-&gt;add_entry(new Translation_Entry(array('singular' =&gt; 'green',)));
-                $guest-&gt;add_entry(new Translation_Entry(array('singular' =&gt; 'red',)));
-                $host-&gt;merge_with($guest);
-                $this-&gt;assertEquals(3, count($host-&gt;entries));
-                $this-&gt;assertEquals(array(), array_diff(array('pink', 'green', 'red'), array_keys($host-&gt;entries)));
-        }
-
-        function test_export_mo_file() {
-                $entries = array();
-                $entries[] = new Translation_Entry(array('singular' =&gt; 'pink',
-                        'translations' =&gt; array('розов')));
-                $no_translation_entry = new Translation_Entry(array('singular' =&gt; 'grey'));
-                $entries[] = new Translation_Entry(array('singular' =&gt; 'green', 'plural' =&gt; 'greens',
-                        'translations' =&gt; array('зелен', 'зелени')));
-                $entries[] = new Translation_Entry(array('singular' =&gt; 'red', 'context' =&gt; 'color',
-                        'translations' =&gt; array('червен')));
-                $entries[] = new Translation_Entry(array('singular' =&gt; 'red', 'context' =&gt; 'bull',
-                        'translations' =&gt; array('бик')));
-                $entries[] = new Translation_Entry(array('singular' =&gt; 'maroon', 'plural' =&gt; 'maroons', 'context' =&gt; 'context',
-                        'translations' =&gt; array('пурпурен', 'пурпурни')));
-
-                $mo = new MO();
-                $mo-&gt;set_header('Project-Id-Version', 'Baba Project 1.0');
-                foreach($entries as $entry) {
-                        $mo-&gt;add_entry($entry);
-                }
-                $mo-&gt;add_entry($no_translation_entry);
-
-                $temp_fn = $this-&gt;temp_filename();
-                $mo-&gt;export_to_file($temp_fn);
-
-                $again = new MO();
-                $again-&gt;import_from_file($temp_fn);
-
-                $this-&gt;assertEquals(count($entries), count($again-&gt;entries));
-                foreach($entries as $entry) {
-                        $this-&gt;assertEquals($entry, $again-&gt;entries[$entry-&gt;key()]);
-                }
-        }
-
-        function test_export_should_not_include_empty_translations() {
-                $entries = array(  );
-                $mo = new MO;
-                $mo-&gt;add_entry( array( 'singular' =&gt; 'baba', 'translations' =&gt; array( '', '' ) ) );
-
-                $temp_fn = $this-&gt;temp_filename();
-                $mo-&gt;export_to_file( $temp_fn );
-
-                $again = new MO();
-                $again-&gt;import_from_file($temp_fn);
-
-                $this-&gt;assertEquals( 0, count( $again-&gt;entries ) );
-        }
-
-        function test_nplurals_with_backslashn() {
-                $mo = new MO();
-                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/bad_nplurals.mo');
-                $this-&gt;assertEquals('%d foro', $mo-&gt;translate_plural('%d forum', '%d forums', 1));
-                $this-&gt;assertEquals('%d foros', $mo-&gt;translate_plural('%d forum', '%d forums', 2));
-                $this-&gt;assertEquals('%d foros', $mo-&gt;translate_plural('%d forum', '%d forums', -1));
-        }
-
-        function disabled_test_performance() {
-                $start = microtime(true);
-                $mo = new MO();
-                $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/de_DE-2.8.mo');
-                // echo &quot;\nPerformance: &quot;.(microtime(true) - $start).&quot;\n&quot;;
-        }
-
-        function test_overloaded_mb_functions() {
-                // skipIf() method skips the whole test case, not only this method
-                // that's why we are skipping it the stupid way
-                if ((ini_get(&quot;mbstring.func_overload&quot;) &amp; 2) != 0) {
-                        $mo = new MO();
-                        $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/overload.mo');
-                        $this-&gt;assertEquals(array('Табло'), $mo-&gt;entries['Dashboard']-&gt;translations);
-                }
-        }
-
-        function test_load_pot_file() {
-                $mo = new MO();
-                $this-&gt;assertEquals( false, $mo-&gt;import_from_file(DIR_TESTDATA . '/pomo/mo.pot') );
-        }
-}
</del></span></pre></div>
<a id="trunktestspomotest_noop_translationsphp"></a>
<div class="delfile"><h4>Deleted: trunk/tests/pomo/test_noop_translations.php (1170 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/test_noop_translations.php        2012-12-19 00:56:28 UTC (rev 1170)
+++ trunk/tests/pomo/test_noop_translations.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-&lt;?php
-
-class WP_Test_NOOP_Translations extends WP_UnitTestCase {
-        function setUp() {
-                parent::setUp();
-                $this-&gt;noop = new NOOP_Translations;
-                $this-&gt;entry = new Translation_Entry( array( 'singular' =&gt; 'baba' ) );
-                $this-&gt;plural_entry = new Translation_Entry(array('singular' =&gt; 'dyado', 'plural' =&gt; 'dyados', 'translations' =&gt; array('dyadox', 'dyadoy')));
-        }
-
-        function test_get_header() {
-                $this-&gt;assertEquals( false, $this-&gt;noop-&gt;get_header( 'Content-Type' ) );
-        }
-
-        function test_add_entry() {
-                $this-&gt;noop-&gt;add_entry( $this-&gt;entry );
-                $this-&gt;assertEquals( array(), $this-&gt;noop-&gt;entries );
-        }
-
-        function test_set_header() {
-                $this-&gt;noop-&gt;set_header( 'header', 'value' );
-                $this-&gt;assertEquals( array(), $this-&gt;noop-&gt;headers );
-        }
-
-        function test_translate_entry() {
-                $this-&gt;noop-&gt;add_entry( $this-&gt;entry );
-                $this-&gt;assertEquals( false, $this-&gt;noop-&gt;translate_entry( $this-&gt;entry ) );
-        }
-
-        function test_translate() {
-                $this-&gt;noop-&gt;add_entry( $this-&gt;entry );
-                $this-&gt;assertEquals( 'baba', $this-&gt;noop-&gt;translate( 'baba' ) );
-        }
-
-        function test_plural() {
-                $this-&gt;noop-&gt;add_entry( $this-&gt;plural_entry );
-                $this-&gt;assertEquals( 'dyado', $this-&gt;noop-&gt;translate_plural( 'dyado', 'dyados', 1 ) );
-                $this-&gt;assertEquals( 'dyados', $this-&gt;noop-&gt;translate_plural( 'dyado', 'dyados', 11 ) );
-                $this-&gt;assertEquals( 'dyados', $this-&gt;noop-&gt;translate_plural( 'dyado', 'dyados', 0 ) );
-        }
-}
</del></span></pre></div>
<a id="trunktestspomotest_pophp"></a>
<div class="delfile"><h4>Deleted: trunk/tests/pomo/test_po.php (1170 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/test_po.php        2012-12-19 00:56:28 UTC (rev 1170)
+++ trunk/tests/pomo/test_po.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -1,218 +0,0 @@
</span><del>-&lt;?php
-
-class WP_Test_PO extends WP_UnitTestCase {
-        function setUp() {
-                require_once ABSPATH . '/wp-includes/pomo/po.php';
-                // not so random wordpress.pot string -- multiple lines
-                $this-&gt;mail = &quot;Your new WordPress blog has been successfully set up at:
-
-%1\$s
-
-You can log in to the administrator account with the following information:
-
-Username: %2\$s
-Password: %3\$s
-
-We hope you enjoy your new blog. Thanks!
-
---The WordPress Team
-http://wordpress.org/
-&quot;;
-        $this-&gt;po_mail = '&quot;&quot;
-&quot;Your new WordPress blog has been successfully set up at:\n&quot;
-&quot;\n&quot;
-&quot;%1$s\n&quot;
-&quot;\n&quot;
-&quot;You can log in to the administrator account with the following information:\n&quot;
-&quot;\n&quot;
-&quot;Username: %2$s\n&quot;
-&quot;Password: %3$s\n&quot;
-&quot;\n&quot;
-&quot;We hope you enjoy your new blog. Thanks!\n&quot;
-&quot;\n&quot;
-&quot;--The WordPress Team\n&quot;
-&quot;http://wordpress.org/\n&quot;';
-                $this-&gt;a90 = str_repeat(&quot;a&quot;, 90);
-                $this-&gt;po_a90 = &quot;\&quot;$this-&gt;a90\&quot;&quot;;
-    }
-
-        function test_prepend_each_line() {
-                $this-&gt;assertEquals('baba_', PO::prepend_each_line('', 'baba_'));
-                $this-&gt;assertEquals('baba_dyado', PO::prepend_each_line('dyado', 'baba_'));
-                $this-&gt;assertEquals(&quot;# baba\n# dyado\n# \n&quot;, PO::prepend_each_line(&quot;baba\ndyado\n\n&quot;, '# '));
-        }
-
-        function test_poify() {
-                //simple
-                $this-&gt;assertEquals('&quot;baba&quot;', PO::poify('baba'));
-                //long word
-                $this-&gt;assertEquals($this-&gt;po_a90, PO::poify($this-&gt;a90));
-                // tab
-                $this-&gt;assertEquals('&quot;ba\tba&quot;', PO::poify(&quot;ba\tba&quot;));
-                // do not add leading empty string of one-line string ending on a newline
-                $this-&gt;assertEquals('&quot;\\\\a\\\\n\\n&quot;', PO::poify(&quot;\a\\n\n&quot;));
-                // backslash
-                $this-&gt;assertEquals('&quot;ba\\\\ba&quot;', PO::poify('ba\\ba'));
-                // random wordpress.pot string
-                $src = 'Categories can be selectively converted to tags using the &lt;a href=&quot;%s&quot;&gt;category to tag converter&lt;/a&gt;.';
-                $this-&gt;assertEquals(&quot;\&quot;Categories can be selectively converted to tags using the &lt;a href=\\\&quot;%s\\\&quot;&gt;category to tag converter&lt;/a&gt;.\&quot;&quot;, PO::poify($src));
-
-                $this-&gt;assertEquals($this-&gt;po_mail, PO::poify($this-&gt;mail));
-        }
-
-        function test_unpoify() {
-                $this-&gt;assertEquals('baba', PO::unpoify('&quot;baba&quot;'));
-                $this-&gt;assertEquals(&quot;baba\ngugu&quot;, PO::unpoify('&quot;baba\n&quot;'.&quot;\t\t\t\n&quot;.'&quot;gugu&quot;'));
-                $this-&gt;assertEquals($this-&gt;a90, PO::unpoify($this-&gt;po_a90));
-                $this-&gt;assertEquals('\\t\\n', PO::unpoify('&quot;\\\\t\\\\n&quot;'));
-                // wordwrapped
-                $this-&gt;assertEquals('babadyado', PO::unpoify(&quot;\&quot;\&quot;\n\&quot;baba\&quot;\n\&quot;dyado\&quot;&quot;));
-                $this-&gt;assertEquals($this-&gt;mail, PO::unpoify($this-&gt;po_mail));
-        }
-
-        function test_export_entry() {
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba'));
-                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;&quot;, PO::export_entry($entry));
-                // plural
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas'));
-                $this-&gt;assertEquals('msgid &quot;baba&quot;
-msgid_plural &quot;babas&quot;
-msgstr[0] &quot;&quot;
-msgstr[1] &quot;&quot;', PO::export_entry($entry));
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'translator_comments' =&gt; &quot;baba\ndyado&quot;));
-                $this-&gt;assertEquals('#  baba
-#  dyado
-msgid &quot;baba&quot;
-msgstr &quot;&quot;', PO::export_entry($entry));
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'extracted_comments' =&gt; &quot;baba&quot;));
-                $this-&gt;assertEquals('#. baba
-msgid &quot;baba&quot;
-msgstr &quot;&quot;', PO::export_entry($entry));
-                $entry = new Translation_Entry(array(
-                        'singular' =&gt; 'baba',
-                        'extracted_comments' =&gt; &quot;baba&quot;,
-                        'references' =&gt; range(1, 29)));
-                $this-&gt;assertEquals('#. baba
-#: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
-#: 29
-msgid &quot;baba&quot;
-msgstr &quot;&quot;', PO::export_entry($entry));
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'translations' =&gt; array()));
-                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;&quot;, PO::export_entry($entry));
-
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'translations' =&gt; array('куку', 'буку')));
-                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;куку\&quot;&quot;, PO::export_entry($entry));
-
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas', 'translations' =&gt; array('кукубуку')));
-                $this-&gt;assertEquals('msgid &quot;baba&quot;
-msgid_plural &quot;babas&quot;
-msgstr[0] &quot;кукубуку&quot;', PO::export_entry($entry));
-
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas', 'translations' =&gt; array('кукубуку', 'кукуруку', 'бабаяга')));
-                $this-&gt;assertEquals('msgid &quot;baba&quot;
-msgid_plural &quot;babas&quot;
-msgstr[0] &quot;кукубуку&quot;
-msgstr[1] &quot;кукуруку&quot;
-msgstr[2] &quot;бабаяга&quot;', PO::export_entry($entry));
-                // context
-                $entry = new Translation_Entry(array('context' =&gt; 'ctxt', 'singular' =&gt; 'baba', 'plural' =&gt; 'babas', 'translations' =&gt; array('кукубуку', 'кукуруку', 'бабаяга'), 'flags' =&gt; array('fuzzy', 'php-format')));
-                $this-&gt;assertEquals('#, fuzzy, php-format
-msgctxt &quot;ctxt&quot;
-msgid &quot;baba&quot;
-msgid_plural &quot;babas&quot;
-msgstr[0] &quot;кукубуку&quot;
-msgstr[1] &quot;кукуруку&quot;
-msgstr[2] &quot;бабаяга&quot;', PO::export_entry($entry));
-    }
-
-        function test_export_entries() {
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba',));
-                $entry2 = new Translation_Entry(array('singular' =&gt; 'dyado',));
-                $po = new PO();
-                $po-&gt;add_entry($entry);
-                $po-&gt;add_entry($entry2);
-                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;\n\nmsgid \&quot;dyado\&quot;\nmsgstr \&quot;\&quot;&quot;, $po-&gt;export_entries());
-        }
-
-        function test_export_headers() {
-                $po = new PO();
-                $po-&gt;set_header('Project-Id-Version', 'WordPress 2.6-bleeding');
-                $po-&gt;set_header('POT-Creation-Date', '2008-04-08 18:00+0000');
-                $this-&gt;assertEquals(&quot;msgid \&quot;\&quot;\nmsgstr \&quot;\&quot;\n\&quot;Project-Id-Version: WordPress 2.6-bleeding\\n\&quot;\n\&quot;POT-Creation-Date: 2008-04-08 18:00+0000\\n\&quot;&quot;, $po-&gt;export_headers());
-        }
-
-        function test_export() {
-                $po = new PO();
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba',));
-                $entry2 = new Translation_Entry(array('singular' =&gt; 'dyado',));
-                $po-&gt;set_header('Project-Id-Version', 'WordPress 2.6-bleeding');
-                $po-&gt;set_header('POT-Creation-Date', '2008-04-08 18:00+0000');
-                $po-&gt;add_entry($entry);
-                $po-&gt;add_entry($entry2);
-                $this-&gt;assertEquals(&quot;msgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;\n\nmsgid \&quot;dyado\&quot;\nmsgstr \&quot;\&quot;&quot;, $po-&gt;export(false));
-                $this-&gt;assertEquals(&quot;msgid \&quot;\&quot;\nmsgstr \&quot;\&quot;\n\&quot;Project-Id-Version: WordPress 2.6-bleeding\\n\&quot;\n\&quot;POT-Creation-Date: 2008-04-08 18:00+0000\\n\&quot;\n\nmsgid \&quot;baba\&quot;\nmsgstr \&quot;\&quot;\n\nmsgid \&quot;dyado\&quot;\nmsgstr \&quot;\&quot;&quot;, $po-&gt;export());
-        }
-
-
-        function test_export_to_file() {
-                $po = new PO();
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba',));
-                $entry2 = new Translation_Entry(array('singular' =&gt; 'dyado',));
-                $po-&gt;set_header('Project-Id-Version', 'WordPress 2.6-bleeding');
-                $po-&gt;set_header('POT-Creation-Date', '2008-04-08 18:00+0000');
-                $po-&gt;add_entry($entry);
-                $po-&gt;add_entry($entry2);
-
-                $temp_fn = $this-&gt;temp_filename();
-                $po-&gt;export_to_file($temp_fn, false);
-                $this-&gt;assertEquals($po-&gt;export(false), file_get_contents($temp_fn));
-
-                $temp_fn2 = $this-&gt;temp_filename();
-                $po-&gt;export_to_file($temp_fn2);
-                $this-&gt;assertEquals($po-&gt;export(), file_get_contents($temp_fn2));
-        }
-
-        function test_import_from_file() {
-                $po = new PO();
-                $res = $po-&gt;import_from_file(DIR_TESTDATA . '/pomo/simple.po');
-                $this-&gt;assertEquals(true, $res);
-
-                $this-&gt;assertEquals(array('Project-Id-Version' =&gt; 'WordPress 2.6-bleeding', 'Plural-Forms' =&gt; 'nplurals=2; plural=n != 1;'), $po-&gt;headers);
-
-                $simple_entry = new Translation_Entry(array('singular' =&gt; 'moon',));
-                $this-&gt;assertEquals($simple_entry, $po-&gt;entries[$simple_entry-&gt;key()]);
-
-                $all_types_entry = new Translation_Entry(array('singular' =&gt; 'strut', 'plural' =&gt; 'struts', 'context' =&gt; 'brum',
-                        'translations' =&gt; array('ztrut0', 'ztrut1', 'ztrut2')));
-                $this-&gt;assertEquals($all_types_entry, $po-&gt;entries[$all_types_entry-&gt;key()]);
-
-                $multiple_line_entry = new Translation_Entry(array('singular' =&gt; 'The first thing you need to do is tell Blogger to let WordPress access your account. You will be sent back here after providing authorization.', 'translations' =&gt; array(&quot;baba\ndyadogugu&quot;)));
-                $this-&gt;assertEquals($multiple_line_entry, $po-&gt;entries[$multiple_line_entry-&gt;key()]);
-
-                $multiple_line_all_types_entry = new Translation_Entry(array('context' =&gt; 'context', 'singular' =&gt; 'singular',
-                        'plural' =&gt; 'plural', 'translations' =&gt; array('translation0', 'translation1', 'translation2')));
-                $this-&gt;assertEquals($multiple_line_all_types_entry, $po-&gt;entries[$multiple_line_all_types_entry-&gt;key()]);
-
-                $comments_entry = new Translation_Entry(array('singular' =&gt; 'a', 'translator_comments' =&gt; &quot;baba\nbrubru&quot;,
-                        'references' =&gt; array('wp-admin/x.php:111', 'baba:333', 'baba'), 'extracted_comments' =&gt; &quot;translators: buuu&quot;,
-                        'flags' =&gt; array('fuzzy')));
-                $this-&gt;assertEquals($comments_entry, $po-&gt;entries[$comments_entry-&gt;key()]);
-
-                $end_quote_entry = new Translation_Entry(array('singular' =&gt; 'a&quot;'));
-                $this-&gt;assertEquals($end_quote_entry, $po-&gt;entries[$end_quote_entry-&gt;key()]);
-        }
-
-        function test_import_from_entry_file_should_give_false() {
-                $po = new PO();
-                $this-&gt;assertFalse( $po-&gt;import_from_file( DIR_TESTDATA . '/pomo/empty.po' ) );
-        }
-
-        function test_import_from_file_with_windows_line_endings_should_work_as_with_unix_line_endings() {
-                $po = new PO();
-                $this-&gt;assertTrue( $po-&gt;import_from_file( DIR_TESTDATA . '/pomo/windows-line-endings.po' ) );
-                $this-&gt;assertEquals( 1, count( $po-&gt;entries ) );
-        }
-
-        //TODO: add tests for bad files
-}
-?&gt;
</del></span></pre></div>
<a id="trunktestspomotest_translation_entryphp"></a>
<div class="delfile"><h4>Deleted: trunk/tests/pomo/test_translation_entry.php (1170 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/test_translation_entry.php        2012-12-19 00:56:28 UTC (rev 1170)
+++ trunk/tests/pomo/test_translation_entry.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-&lt;?php
-
-class WP_Test_Translation_Entry extends WP_UnitTestCase {
-
-    function test_create_entry() {
-                // no singular =&gt; empty object
-                $entry = new Translation_Entry();
-                $this-&gt;assertNull($entry-&gt;singular);
-                $this-&gt;assertNull($entry-&gt;plural);
-                $this-&gt;assertFalse($entry-&gt;is_plural);
-                // args -&gt; members
-                $entry = new Translation_Entry(array(
-                        'singular' =&gt; 'baba',
-                        'plural' =&gt; 'babas',
-                        'translations' =&gt; array('баба', 'баби'),
-                        'references' =&gt; 'should be array here',
-                        'flags' =&gt; 'baba',
-                ));
-                $this-&gt;assertEquals('baba', $entry-&gt;singular);
-                $this-&gt;assertEquals('babas', $entry-&gt;plural);
-                $this-&gt;assertTrue($entry-&gt;is_plural);
-                $this-&gt;assertEquals(array('баба', 'баби'), $entry-&gt;translations);
-                $this-&gt;assertEquals(array(), $entry-&gt;references);
-                $this-&gt;assertEquals(array(), $entry-&gt;flags);
-        }
-
-        function test_key() {
-                $entry_baba = new Translation_Entry(array('singular' =&gt; 'baba',));
-                $entry_dyado = new Translation_Entry(array('singular' =&gt; 'dyado',));
-                $entry_baba_ctxt = new Translation_Entry(array('singular' =&gt; 'baba', 'context' =&gt; 'x'));
-                $entry_baba_plural = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas'));
-                $this-&gt;assertEquals($entry_baba-&gt;key(), $entry_baba_plural-&gt;key());
-                $this-&gt;assertNotEquals($entry_baba-&gt;key(), $entry_baba_ctxt-&gt;key());
-                $this-&gt;assertNotEquals($entry_baba_plural-&gt;key(), $entry_baba_ctxt-&gt;key());
-                $this-&gt;assertNotEquals($entry_baba-&gt;key(), $entry_dyado-&gt;key());
-        }
-}
</del></span></pre></div>
<a id="trunktestspomotest_translationsphp"></a>
<div class="delfile"><h4>Deleted: trunk/tests/pomo/test_translations.php (1170 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/test_translations.php        2012-12-19 00:56:28 UTC (rev 1170)
+++ trunk/tests/pomo/test_translations.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-&lt;?php
-class WP_Test_Translations extends WP_UnitTestCase {
-
-        function test_add_entry() {
-                $entry = new Translation_Entry(array('singular' =&gt; 'baba',));
-                $entry2 = new Translation_Entry(array('singular' =&gt; 'dyado',));
-                $empty = new Translation_Entry();
-                $po = new Translations();
-                $po-&gt;add_entry($entry);
-                $this-&gt;assertEquals(array($entry-&gt;key() =&gt; $entry), $po-&gt;entries);
-                // add the same entry more than once
-                // we do not need to test proper key generation here, see test_key()
-                $po-&gt;add_entry($entry);
-                $po-&gt;add_entry($entry);
-                $this-&gt;assertEquals(array($entry-&gt;key() =&gt; $entry), $po-&gt;entries);
-                $po-&gt;add_entry($entry2);
-                $this-&gt;assertEquals(array($entry-&gt;key() =&gt; $entry, $entry2-&gt;key() =&gt; $entry2), $po-&gt;entries);
-                // add empty entry
-                $this-&gt;assertEquals(false, $po-&gt;add_entry($empty));
-                $this-&gt;assertEquals(array($entry-&gt;key() =&gt; $entry, $entry2-&gt;key() =&gt; $entry2), $po-&gt;entries);
-
-                // give add_entry() the arguments and let it create the entry itself
-                $po = new Translations();
-                $po-&gt;add_entry(array('singular' =&gt; 'baba',));
-                $entries= array_values($po-&gt;entries);
-                $this-&gt;assertEquals($entry-&gt;key(), $entries[0]-&gt;key());
-        }
-
-        function test_translate() {
-                $entry1 = new Translation_Entry(array('singular' =&gt; 'baba', 'translations' =&gt; array('babax')));
-                $entry2 = new Translation_Entry(array('singular' =&gt; 'baba', 'translations' =&gt; array('babay'), 'context' =&gt; 'x'));
-                $domain = new Translations();
-                $domain-&gt;add_entry($entry1);
-                $domain-&gt;add_entry($entry2);
-                $this-&gt;assertEquals('babax', $domain-&gt;translate('baba'));
-                $this-&gt;assertEquals('babay', $domain-&gt;translate('baba', 'x'));
-                $this-&gt;assertEquals('baba', $domain-&gt;translate('baba', 'y'));
-                $this-&gt;assertEquals('babaz', $domain-&gt;translate('babaz'));
-        }
-
-        function test_translate_plural() {
-                $entry_incomplete = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas', 'translations' =&gt; array('babax')));
-                $entry_toomany = new Translation_Entry(array('singular' =&gt; 'wink', 'plural' =&gt; 'winks', 'translations' =&gt; array('winki', 'winka', 'winko')));
-                $entry_2 = new Translation_Entry(array('singular' =&gt; 'dyado', 'plural' =&gt; 'dyados', 'translations' =&gt; array('dyadox', 'dyadoy')));
-                $domain = new Translations();
-                $domain-&gt;add_entry($entry_incomplete);
-                $domain-&gt;add_entry($entry_toomany);
-                $domain-&gt;add_entry($entry_2);
-                $this-&gt;assertEquals('other', $domain-&gt;translate_plural('other', 'others', 1));
-                $this-&gt;assertEquals('others', $domain-&gt;translate_plural('other', 'others', 111));
-                // too few translations + cont logic
-                $this-&gt;assertEquals('babas', $domain-&gt;translate_plural('baba', 'babas', 2));
-                $this-&gt;assertEquals('babas', $domain-&gt;translate_plural('baba', 'babas', 0));
-                $this-&gt;assertEquals('babas', $domain-&gt;translate_plural('baba', 'babas', -1));
-                $this-&gt;assertEquals('babas', $domain-&gt;translate_plural('baba', 'babas', 999));
-                // proper
-                $this-&gt;assertEquals('dyadox', $domain-&gt;translate_plural('dyado', 'dyados', 1));
-                $this-&gt;assertEquals('dyadoy', $domain-&gt;translate_plural('dyado', 'dyados', 0));
-                $this-&gt;assertEquals('dyadoy', $domain-&gt;translate_plural('dyado', 'dyados', 18881));
-                $this-&gt;assertEquals('dyadoy', $domain-&gt;translate_plural('dyado', 'dyados', -18881));
-        }
-
-        function test_digit_and_merge() {
-                $entry_digit_1 = new Translation_Entry(array('singular' =&gt; 1, 'translations' =&gt; array('1')));
-                $entry_digit_2 = new Translation_Entry(array('singular' =&gt; 2, 'translations' =&gt; array('2')));
-                $domain = new Translations();
-                $domain-&gt;add_entry($entry_digit_1);
-                $domain-&gt;add_entry($entry_digit_2);
-                $dummy_translation = new Translations;
-                $this-&gt;assertEquals( '1', $domain-&gt;translate( '1' ) );
-                $domain-&gt;merge_with( $dummy_translation );
-                $this-&gt;assertEquals( '1', $domain-&gt;translate( '1' ) );
-        }
-
-}
</del></span></pre></div>
<a id="trunktestspomotranslationEntryphpfromrev1169trunktestspomotest_translation_entryphp"></a>
<div class="copfile"><h4>Copied: trunk/tests/pomo/translationEntry.php (from rev 1169, trunk/tests/pomo/test_translation_entry.php) (0 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/translationEntry.php                                (rev 0)
+++ trunk/tests/pomo/translationEntry.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+&lt;?php
+
+class Tests_POMO_Translation_Entry extends WP_UnitTestCase {
+
+    function test_create_entry() {
+                // no singular =&gt; empty object
+                $entry = new Translation_Entry();
+                $this-&gt;assertNull($entry-&gt;singular);
+                $this-&gt;assertNull($entry-&gt;plural);
+                $this-&gt;assertFalse($entry-&gt;is_plural);
+                // args -&gt; members
+                $entry = new Translation_Entry(array(
+                        'singular' =&gt; 'baba',
+                        'plural' =&gt; 'babas',
+                        'translations' =&gt; array('баба', 'баби'),
+                        'references' =&gt; 'should be array here',
+                        'flags' =&gt; 'baba',
+                ));
+                $this-&gt;assertEquals('baba', $entry-&gt;singular);
+                $this-&gt;assertEquals('babas', $entry-&gt;plural);
+                $this-&gt;assertTrue($entry-&gt;is_plural);
+                $this-&gt;assertEquals(array('баба', 'баби'), $entry-&gt;translations);
+                $this-&gt;assertEquals(array(), $entry-&gt;references);
+                $this-&gt;assertEquals(array(), $entry-&gt;flags);
+        }
+
+        function test_key() {
+                $entry_baba = new Translation_Entry(array('singular' =&gt; 'baba',));
+                $entry_dyado = new Translation_Entry(array('singular' =&gt; 'dyado',));
+                $entry_baba_ctxt = new Translation_Entry(array('singular' =&gt; 'baba', 'context' =&gt; 'x'));
+                $entry_baba_plural = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas'));
+                $this-&gt;assertEquals($entry_baba-&gt;key(), $entry_baba_plural-&gt;key());
+                $this-&gt;assertNotEquals($entry_baba-&gt;key(), $entry_baba_ctxt-&gt;key());
+                $this-&gt;assertNotEquals($entry_baba_plural-&gt;key(), $entry_baba_ctxt-&gt;key());
+                $this-&gt;assertNotEquals($entry_baba-&gt;key(), $entry_dyado-&gt;key());
+        }
+}
</ins></span></pre></div>
<a id="trunktestspomotranslationsphpfromrev1169trunktestspomotest_translationsphp"></a>
<div class="copfile"><h4>Copied: trunk/tests/pomo/translations.php (from rev 1169, trunk/tests/pomo/test_translations.php) (0 => 1171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/pomo/translations.php                                (rev 0)
+++ trunk/tests/pomo/translations.php        2012-12-19 01:28:04 UTC (rev 1171)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+&lt;?php
+class Tests_POMO_Translations extends WP_UnitTestCase {
+
+        function test_add_entry() {
+                $entry = new Translation_Entry(array('singular' =&gt; 'baba',));
+                $entry2 = new Translation_Entry(array('singular' =&gt; 'dyado',));
+                $empty = new Translation_Entry();
+                $po = new Translations();
+                $po-&gt;add_entry($entry);
+                $this-&gt;assertEquals(array($entry-&gt;key() =&gt; $entry), $po-&gt;entries);
+                // add the same entry more than once
+                // we do not need to test proper key generation here, see test_key()
+                $po-&gt;add_entry($entry);
+                $po-&gt;add_entry($entry);
+                $this-&gt;assertEquals(array($entry-&gt;key() =&gt; $entry), $po-&gt;entries);
+                $po-&gt;add_entry($entry2);
+                $this-&gt;assertEquals(array($entry-&gt;key() =&gt; $entry, $entry2-&gt;key() =&gt; $entry2), $po-&gt;entries);
+                // add empty entry
+                $this-&gt;assertEquals(false, $po-&gt;add_entry($empty));
+                $this-&gt;assertEquals(array($entry-&gt;key() =&gt; $entry, $entry2-&gt;key() =&gt; $entry2), $po-&gt;entries);
+
+                // give add_entry() the arguments and let it create the entry itself
+                $po = new Translations();
+                $po-&gt;add_entry(array('singular' =&gt; 'baba',));
+                $entries= array_values($po-&gt;entries);
+                $this-&gt;assertEquals($entry-&gt;key(), $entries[0]-&gt;key());
+        }
+
+        function test_translate() {
+                $entry1 = new Translation_Entry(array('singular' =&gt; 'baba', 'translations' =&gt; array('babax')));
+                $entry2 = new Translation_Entry(array('singular' =&gt; 'baba', 'translations' =&gt; array('babay'), 'context' =&gt; 'x'));
+                $domain = new Translations();
+                $domain-&gt;add_entry($entry1);
+                $domain-&gt;add_entry($entry2);
+                $this-&gt;assertEquals('babax', $domain-&gt;translate('baba'));
+                $this-&gt;assertEquals('babay', $domain-&gt;translate('baba', 'x'));
+                $this-&gt;assertEquals('baba', $domain-&gt;translate('baba', 'y'));
+                $this-&gt;assertEquals('babaz', $domain-&gt;translate('babaz'));
+        }
+
+        function test_translate_plural() {
+                $entry_incomplete = new Translation_Entry(array('singular' =&gt; 'baba', 'plural' =&gt; 'babas', 'translations' =&gt; array('babax')));
+                $entry_toomany = new Translation_Entry(array('singular' =&gt; 'wink', 'plural' =&gt; 'winks', 'translations' =&gt; array('winki', 'winka', 'winko')));
+                $entry_2 = new Translation_Entry(array('singular' =&gt; 'dyado', 'plural' =&gt; 'dyados', 'translations' =&gt; array('dyadox', 'dyadoy')));
+                $domain = new Translations();
+                $domain-&gt;add_entry($entry_incomplete);
+                $domain-&gt;add_entry($entry_toomany);
+                $domain-&gt;add_entry($entry_2);
+                $this-&gt;assertEquals('other', $domain-&gt;translate_plural('other', 'others', 1));
+                $this-&gt;assertEquals('others', $domain-&gt;translate_plural('other', 'others', 111));
+                // too few translations + cont logic
+                $this-&gt;assertEquals('babas', $domain-&gt;translate_plural('baba', 'babas', 2));
+                $this-&gt;assertEquals('babas', $domain-&gt;translate_plural('baba', 'babas', 0));
+                $this-&gt;assertEquals('babas', $domain-&gt;translate_plural('baba', 'babas', -1));
+                $this-&gt;assertEquals('babas', $domain-&gt;translate_plural('baba', 'babas', 999));
+                // proper
+                $this-&gt;assertEquals('dyadox', $domain-&gt;translate_plural('dyado', 'dyados', 1));
+                $this-&gt;assertEquals('dyadoy', $domain-&gt;translate_plural('dyado', 'dyados', 0));
+                $this-&gt;assertEquals('dyadoy', $domain-&gt;translate_plural('dyado', 'dyados', 18881));
+                $this-&gt;assertEquals('dyadoy', $domain-&gt;translate_plural('dyado', 'dyados', -18881));
+        }
+
+        function test_digit_and_merge() {
+                $entry_digit_1 = new Translation_Entry(array('singular' =&gt; 1, 'translations' =&gt; array('1')));
+                $entry_digit_2 = new Translation_Entry(array('singular' =&gt; 2, 'translations' =&gt; array('2')));
+                $domain = new Translations();
+                $domain-&gt;add_entry($entry_digit_1);
+                $domain-&gt;add_entry($entry_digit_2);
+                $dummy_translation = new Translations;
+                $this-&gt;assertEquals( '1', $domain-&gt;translate( '1' ) );
+                $domain-&gt;merge_with( $dummy_translation );
+                $this-&gt;assertEquals( '1', $domain-&gt;translate( '1' ) );
+        }
+
+}
</ins></span></pre>
</div>
</div>

</body>
</html>