Package fr.adrienbrault.idea.symfony2plugin.tests.templating.path

Source Code of fr.adrienbrault.idea.symfony2plugin.tests.templating.path.TwigPathServiceParserTest

package fr.adrienbrault.idea.symfony2plugin.tests.templating.path;

import fr.adrienbrault.idea.symfony2plugin.templating.path.TwigPathIndex;
import fr.adrienbrault.idea.symfony2plugin.templating.path.TwigPathServiceParser;
import org.junit.Assert;
import org.junit.Test;

import java.io.File;

/**
* @author Daniel Espendiller <daniel@espendiller.net>
*/
public class TwigPathServiceParserTest extends Assert {

    @Test
    public void testParse() throws Exception {

        File testFile = new File(this.getClass().getResource("appDevDebugProjectContainer.xml").getFile());

        TwigPathServiceParser parser = new TwigPathServiceParser();
        parser.parser(testFile);

        assertEquals("vendor\\symfony\\symfony\\src\\Symfony\\Bundle\\FrameworkBundle/Resources/views", parser.getTwigPathIndex().getNamespacePaths("Framework").get(0).getPath());
        assertEquals("vendor\\foo\\bar\\FooBundle/Resources/views", parser.getTwigPathIndex().getNamespacePaths("Framework").get(1).getPath());

        assertEquals("vendor\\symfony\\symfony\\src\\Symfony\\Bridge\\Twig/Resources/views/Form", parser.getTwigPathIndex().getNamespacePaths(TwigPathIndex.MAIN).get(0).getPath());
        assertEquals("app/Resources/views", parser.getTwigPathIndex().getNamespacePaths(TwigPathIndex.MAIN).get(1).getPath());

    }

}
TOP

Related Classes of fr.adrienbrault.idea.symfony2plugin.tests.templating.path.TwigPathServiceParserTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.