package fr.adrienbrault.idea.symfony2plugin.tests.config.yaml.completion;

import fr.adrienbrault.idea.symfony2plugin.tests.SymfonyLightCodeInsightFixtureTestCase;

/**
 * @author Daniel Espendiller <daniel@espendiller.net>
 * @see fr.adrienbrault.idea.symfony2plugin.config.yaml.completion.ConfigCompletionProvider
 */
public class ConfigCompletionProviderTest extends SymfonyLightCodeInsightFixtureTestCase {

    public void testConfigFileCompletion() {
        assertCompletionContains("config.yml", "" +
                "framework:\n" +
                "   b<caret>\n" +
                "   foo: foo\n",
            "base_url"
        );

        assertCompletionContains("config.yml", "" +
                "framework:\n" +
                "   templating:\n" +
                "       a<caret>\n" +
                "       foo: foo\n",
            "assets_base_url"
        );
    }

    public void testConfigInRootFileCompletion() {
        assertCompletionContains("config.yml", "" +
                "framework:\n" +
                "   foo: ~\n" +
                "<caret>",
            "framework", "swiftmailer"
        );
    }
}

@@ -1132,11 +1132,444 @@
 );%0A    %7D
+%0A%0A    public void testXmlNormalize() %7B%0A        assertCompletionContains(%22config.yml%22, %22%22 +%0A                %22web_profiler:%5Cn%22 +%0A                %22   t%3Ccaret%3E%5Cn%22 +%0A                %22   foo: foo%5Cn%22,%0A            %22toolbar%22%0A        );%0A%0A        assertCompletionContains(%22config.yml%22, %22%22 +%0A                %22web_profiler:%5Cn%22 +%0A                %22   i%3Ccaret%3E%5Cn%22 +%0A                %22   foo: foo%5Cn%22,%0A            %22intercept_redirects%22%0A        );%0A    %7D
 %0A%7D%0A

add test for yaml -> xml configuration normalization