Search in sources :

Example 1 with MoodlePHPFilter

use of org.omegat.filters2.moodlephp.MoodlePHPFilter in project omegat by omegat-org.

the class MoodlePHPFilterTest method testAlign.

@Test
public void testAlign() throws Exception {
    final AlignResult ar = new AlignResult();
    align(new MoodlePHPFilter(), "MoodlePHP/filesAlign.php", "MoodlePHP/filesAlign_gl.php", new IAlignCallback() {

        public void addTranslation(String id, String source, String translation, boolean isFuzzy, String path, IFilter filter) {
            ar.found = id.equals("access") && source.equals("Accessibility") && translation.equals("Accesibilidade");
        }
    });
    assertTrue(ar.found);
}
Also used : IFilter(org.omegat.filters2.IFilter) MoodlePHPFilter(org.omegat.filters2.moodlephp.MoodlePHPFilter) IAlignCallback(org.omegat.filters2.IAlignCallback) Test(org.junit.Test)

Example 2 with MoodlePHPFilter

use of org.omegat.filters2.moodlephp.MoodlePHPFilter in project omegat by omegat-org.

the class MoodlePHPFilterTest method testLoad.

@Test
public void testLoad() throws Exception {
    String f = "test/data/filters/MoodlePHP/file.php";
    IProject.FileInfo fi = loadSourceFiles(new MoodlePHPFilter(), f);
    checkMultiStart(fi, f);
    checkMulti("Accessibility", "access", null, null, null, null);
    checkMulti("Accessibility help", "accesshelp", null, null, null, null);
    checkMulti("Unrecognised options:\n" + "  {$a}\n" + "Please use --help option.", "cliunknowoption", null, null, null, null);
    checkMulti("You cannot uninstall the \\'{$a->filter}\\' because it is part of the \\'{$a->module}\\' module.", "cannotdeletemodfilter", null, null, null, null);
    checkMulti("List of groups or contexts whose members are allowed to create attributes. Separate multiple groups with \\';\\'. Usually something like \\'cn=teachers,ou=staff,o=myorg\\'", "auth_ldap_attrcreators", null, null, null, null);
    checkMultiEnd();
}
Also used : MoodlePHPFilter(org.omegat.filters2.moodlephp.MoodlePHPFilter) IProject(org.omegat.core.data.IProject) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 MoodlePHPFilter (org.omegat.filters2.moodlephp.MoodlePHPFilter)2 IProject (org.omegat.core.data.IProject)1 IAlignCallback (org.omegat.filters2.IAlignCallback)1 IFilter (org.omegat.filters2.IFilter)1