TwigRenderTest::testRender()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
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