Code Duplication    Length = 8-11 lines in 3 locations

tests/ArrayExtensionTest.php 1 location

@@ 8-15 (lines=8) @@
5
6
class ArrayExtensionTest extends \PHPUnit_Framework_TestCase  {
7
8
    private function buildEnv($template) {
9
        $loader = new \Twig_Loader_Array(array(
10
            'template' => $template,
11
        ));
12
        $twig = new \Twig_Environment($loader);
13
        $twig->addExtension(new ArrayExtension());
14
        return $twig;
15
    }
16
    
17
    private function process($template, $data = array()) {
18
        $twig = $this->buildEnv($template);

tests/DateExtensionTest.php 1 location

@@ 16-25 (lines=10) @@
13
        \Locale::setDefault("en_EN");
14
    }
15
    
16
    protected function buildEnv($template)
17
    {
18
        $loader = new \Twig_Loader_Array(array(
19
            'template' => $template,
20
        ));
21
        
22
        $twig = new \Twig_Environment($loader);
23
        $twig->addExtension(new DateExtension());
24
        return $twig;
25
    }
26
    
27
    protected function process($template, $data = array())
28
    {

tests/support/TestHelper.php 1 location

@@ 23-33 (lines=11) @@
20
     * @param string $template
21
     * @return \Twig_Environment
22
     */
23
    protected function buildEnv($template)
24
    {
25
        $loader = new \Twig_Loader_Array([
26
            'template' => $template,
27
        ]);
28
        $twig = new \Twig_Environment($loader);
29
        
30
        $twig->addExtension($this->getExtension());
31
        
32
        return $twig;
33
    }
34
    
35
    /**
36
     * Render template