TwigRenderTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 33
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A dataProvider() 0 6 1
A testRender() 0 7 1
1
<?php
2
3
namespace Starkerxp\CampaignBundle\Tests\Render;
4
5
use Starkerxp\CampaignBundle\Render\TwigRender;
6
7
class TwigRenderTest extends \Starkerxp\StructureBundle\Test\WebTest
8
{
9
    /** @var TwigRender */
10
    protected $renderService;
11
12
    public function setUp()
13
    {
14
        parent::setUp();
15
        $this->renderService = $this->getContainer()->get('starkerxp_campaign.render.twig');
16
    }
17
18
    public function dataProvider()
19
    {
20
        return [
21
            ['Bonjour {{prenom|capitalize}} {{nom |upper}}.', ['nom' => 'CAOUIsSIN', 'prenom' => 'guillaume'], 'Bonjour Guillaume CAOUISSIN.'],
22
        ];
23
    }
24
25
    /**
26
     * @group campaign
27
     * @group render
28
     * @group twig
29
     *
30
     * @dataProvider dataProvider
31
     */
32
    public function testRender($message, $params, $expected)
33
    {
34
        $this->renderService->setContenu($message);
35
        $this->renderService->setData($params);
36
        $actual = $this->renderService->render();
37
        $this->assertEquals($expected, $actual);
38
    }
39
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
40