<commit_before>package com.cedricziel.idea.typo3.translation;

import com.cedricziel.idea.typo3.AbstractTestCase;
import com.cedricziel.idea.typo3.TYPO3CMSProjectSettings;

public class TranslationFoldingBuilderTest_193 extends AbstractTestCase {
    @Override
    protected String getTestDataPath() {
        return super.getTestDataPath() + "/translation";
    }

    public void testXMLTranslationsCanBeFolded() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = true;
        TYPO3CMSProjectSettings.getInstance(getProject()).translationFavoriteLocale = "en";

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xml.xml", "foo/Resources/Private/Language/locallang.xml");

        myFixture.configureByFile("folding_xml_test.php");

        myFixture.testFolding(getTestDataPath() + "/folding_xml_result_193.php");
    }

    public void testXMLTranslationsCanBeFoldedInNonDefaultLanguage() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = true;
        TYPO3CMSProjectSettings.getInstance(getProject()).translationFavoriteLocale = "de";

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xml.xml", "foo/Resources/Private/Language/locallang.xml");

        myFixture.configureByFile("folding_nondefault_xml_test.php");

        myFixture.testFolding(getTestDataPath() + "/folding_nondefault_xml_result_193.php");
    }

    public void testXMLTranslationsAreNotFoldedWhenPluginIsDisabled() {
        disablePlugin();

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xml.xml", "foo/Resources/Private/Language/locallang.xml");

        myFixture.configureByFile("no_folding_xml_test.php");

        myFixture.testFolding(getTestDataPath() + "/no_folding_xml_result.php");
    }

    public void testXMLTranslationsAreNotFoldedWhenDisabledInPluginSettings() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = false;

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xml.xml", "foo/Resources/Private/Language/locallang.xml");

        myFixture.configureByFile("no_folding_xml_test.php");

        myFixture.testFolding(getTestDataPath() + "/no_folding_xml_result.php");
    }

    public void testXLFTranslationsCanBeFolded() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = true;
        TYPO3CMSProjectSettings.getInstance(getProject()).translationFavoriteLocale = "en";

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xlf.xlf", "foo/Resources/Private/Language/locallang.xlf");

        myFixture.configureByFile("folding_xlf_test.php");

        myFixture.testFolding(getTestDataPath() + "/folding_xlf_result_193.php");
    }

    public void testXLFTranslationsCanBeFoldedInNonDefaultLanguage() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = true;
        TYPO3CMSProjectSettings.getInstance(getProject()).translationFavoriteLocale = "de";

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xlf.xlf", "foo/Resources/Private/Language/locallang.xlf");

        myFixture.configureByFile("folding_nondefault_xlf_test.php");

        myFixture.testFolding(getTestDataPath() + "/folding_nondefault_xlf_result.php");
    }

    public void testXLFTranslationsAreNotFoldedWhenPluginIsDisabled() {
        disablePlugin();

        myFixture.addFileToProject("foo/ext_emconf.php", "");<commit_msg>[T3CMS] Fix fixture reference<commit_after>package com.cedricziel.idea.typo3.translation;

import com.cedricziel.idea.typo3.AbstractTestCase;
import com.cedricziel.idea.typo3.TYPO3CMSProjectSettings;

public class TranslationFoldingBuilderTest_193 extends AbstractTestCase {
    @Override
    protected String getTestDataPath() {
        return super.getTestDataPath() + "/translation";
    }

    public void testXMLTranslationsCanBeFolded() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = true;
        TYPO3CMSProjectSettings.getInstance(getProject()).translationFavoriteLocale = "en";

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xml.xml", "foo/Resources/Private/Language/locallang.xml");

        myFixture.configureByFile("folding_xml_test.php");

        myFixture.testFolding(getTestDataPath() + "/folding_xml_result_193.php");
    }

    public void testXMLTranslationsCanBeFoldedInNonDefaultLanguage() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = true;
        TYPO3CMSProjectSettings.getInstance(getProject()).translationFavoriteLocale = "de";

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xml.xml", "foo/Resources/Private/Language/locallang.xml");

        myFixture.configureByFile("folding_nondefault_xml_test.php");

        myFixture.testFolding(getTestDataPath() + "/folding_nondefault_xml_result_193.php");
    }

    public void testXMLTranslationsAreNotFoldedWhenPluginIsDisabled() {
        disablePlugin();

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xml.xml", "foo/Resources/Private/Language/locallang.xml");

        myFixture.configureByFile("no_folding_xml_test.php");

        myFixture.testFolding(getTestDataPath() + "/no_folding_xml_result.php");
    }

    public void testXMLTranslationsAreNotFoldedWhenDisabledInPluginSettings() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = false;

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xml.xml", "foo/Resources/Private/Language/locallang.xml");

        myFixture.configureByFile("no_folding_xml_test.php");

        myFixture.testFolding(getTestDataPath() + "/no_folding_xml_result.php");
    }

    public void testXLFTranslationsCanBeFolded() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = true;
        TYPO3CMSProjectSettings.getInstance(getProject()).translationFavoriteLocale = "en";

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xlf.xlf", "foo/Resources/Private/Language/locallang.xlf");

        myFixture.configureByFile("folding_xlf_test.php");

        myFixture.testFolding(getTestDataPath() + "/folding_xlf_result_193.php");
    }

    public void testXLFTranslationsCanBeFoldedInNonDefaultLanguage() {
        TYPO3CMSProjectSettings.getInstance(getProject()).translationEnableTextFolding = true;
        TYPO3CMSProjectSettings.getInstance(getProject()).translationFavoriteLocale = "de";

        myFixture.addFileToProject("foo/ext_emconf.php", "");
        myFixture.copyFileToProject("folding_xlf.xlf", "foo/Resources/Private/Language/locallang.xlf");

        myFixture.configureByFile("folding_nondefault_xlf_test.php");

        myFixture.testFolding(getTestDataPath() + "/folding_nondefault_xlf_result_193.php");
    }

    public void testXLFTranslationsAreNotFoldedWhenPluginIsDisabled() {
        disablePlugin();

        myFixture.addFileToProject("foo/ext_emconf.php", "");
{'fraction_non_alphanumeric': 0.11202767429483768, 'fraction_numerical': 0.007184672698243746, 'mean_word_length': 4.791217257318952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 40}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5633830', 'n_tokens_mistral': 2375, 'n_tokens_neox': 2256, 'n_words': 195}