Code Duplication    Length = 9-11 lines in 6 locations

tests/PluginTest.php 6 locations

@@ 53-61 (lines=9) @@
50
        $this->assertEquals($twigTemplate->render([]), 'Hello John');
51
    }
52
53
    public function testTruncateFilterForFive()
54
    {
55
        $twig = $this->getTwig();
56
57
        $template = "{{ 'Gordon Freeman' | truncate(5) }}";
58
59
        $twigTemplate = $twig->createTemplate($template);
60
        $this->assertEquals($twigTemplate->render([]), 'Gordo...');
61
    }
62
63
    public function testTruncateFilterForDefault()
64
    {
@@ 73-81 (lines=9) @@
70
        $this->assertEquals($twigTemplate->render([]), 'Lorem ipsum dolor sit amet, co...');
71
    }
72
73
    public function testTruncateFilterWithSeparator()
74
    {
75
        $twig = $this->getTwig();
76
77
        $template = "{{ 'Gordon Freeman' | truncate(5, false, '-') }}";
78
79
        $twigTemplate = $twig->createTemplate($template);
80
        $this->assertEquals($twigTemplate->render([]), 'Gordo-');
81
    }
82
83
    public function testWordWrapFilter()
84
    {
@@ 104-112 (lines=9) @@
101
        $twigTemplate->render([]);
102
    }
103
104
    public function testShuffleFilterForeach()
105
    {
106
        $twig = $this->getTwig();
107
108
        $template = "{% for i in [1, 2, 3] | shuffle %}{{ i }}{% endfor %}";
109
110
        $twigTemplate = $twig->createTemplate($template);
111
        $this->assertEquals(strlen($twigTemplate->render([])), 3);
112
    }
113
114
    public function testTimeDiffFunction()
115
    {
@@ 206-214 (lines=9) @@
203
        $this->assertEquals($twigTemplate->render([]), ' best best best');
204
    }
205
206
    public function testPluralFunction()
207
    {
208
        $twig = $this->getTwig();
209
210
        $template = "{{ 'mail' | plural(count) }}";
211
212
        $twigTemplate = $twig->createTemplate($template);
213
        $this->assertEquals($twigTemplate->render([]), 'mails');
214
    }
215
216
    public function testStrpadFunction()
217
    {
@@ 246-254 (lines=9) @@
243
        $this->assertEquals($twigTemplate->render([]), '   test');
244
    }
245
246
    public function testRightpadFunction()
247
    {
248
        $twig = $this->getTwig();
249
250
        $template = "{{ 'test' | rightpad(7, 'o') }}";
251
252
        $twigTemplate = $twig->createTemplate($template);
253
        $this->assertEquals($twigTemplate->render([]), 'testooo');
254
    }
255
256
    public function testRtlFunction()
257
    {
@@ 352-362 (lines=11) @@
349
        $this->assertEquals($twigTemplate->render([]), $value);
350
    }
351
352
    public function testSessionFunction()
353
    {
354
        $twig = $this->getTwig();
355
356
        session(['my.session.key' => 'test value']);
357
358
        $template = "{{ session('my.session.key') }}";
359
360
        $twigTemplate = $twig->createTemplate($template);
361
        $this->assertEquals($twigTemplate->render([]), 'test value');
362
    }
363
364
    public function testTransFunction()
365
    {