Code Duplication    Length = 8-8 lines in 4 locations

tests/Jasny/Twig/ArrayExtensionTest.php 1 location

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

tests/Jasny/Twig/DateExtensionTest.php 1 location

@@ 14-21 (lines=8) @@
11
        Locale::setDefault("en_CA");
12
    }
13
    
14
    private function buildEnv($template) {
15
        $loader = new Twig_Loader_Array(array(
16
            'template' => $template,
17
        ));
18
        $twig = new Twig_Environment($loader);
19
        $twig->addExtension(new DateExtension());
20
        return $twig;
21
    }
22
    
23
    private function process($template, $data = array()) {
24
        $twig = $this->buildEnv($template);

tests/Jasny/Twig/PcreExtensionTest.php 1 location

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

tests/Jasny/Twig/TextExtensionTest.php 1 location

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