Completed
Push — master ( 4bb011...4b99be )
by Guillaume
13:23
created

OctosendTxtRenderTest::dataProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 11

Duplication

Lines 19
Ratio 100 %

Importance

Changes 0
Metric Value
dl 19
loc 19
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
3
namespace Starkerxp\CampaignBundle\Tests\Render;
4
5
use Starkerxp\CampaignBundle\Render\OctosendTxtRender;
6
7 View Code Duplication
class OctosendTxtRenderTest extends \Starkerxp\StructureBundle\Tests\WebTest
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /** @var OctosendTxtRender */
10
    protected $renderService;
11
12
    public function setUp()
13
    {
14
        parent::setUp();
15
        $this->renderService = $this->getContainer()->get('starkerxp_campaign.render.octosend_txt');
16
    }
17
18
    public function dataProvider()
19
    {
20
        $export = [
21
            'lien mirroir'        => ['[{@mirror}]', [], '{{mirror}}'],
22
            'pixel'               => ['[{@pixel}]', [], '{{pixel}}'],
23
            'lien desinscription' => [
24
                '<a data-id="unsub" target="__blank" href="http://google.fr" style="color:black;">Mon lien</a>',
25
                [],
26
                '[Désinscription] {{unsubscribe:http://google.fr}}',
27
            ],
28
            'lien clickable'      => [
29
                '<a data-id="click" target="__blank" href="http://google.fr" style="color:black;">Mon lien</a>',
30
                [],
31
                '[Mon lien] {{click:http://google.fr}}',
32
            ],
33
        ];
34
35
        return $export;
36
    }
37
38
    /**
39
     * @group campaign
40
     * @group render
41
     * @group octosend
42
     *
43
     * @dataProvider dataProvider
44
     */
45
    public function testRender($message, $params, $expected)
46
    {
47
        $this->renderService->setContenu($message);
48
        $this->renderService->setData($params);
49
        $actual = $this->renderService->render();
50
        $this->assertEquals($expected, $actual);
51
    }
52
}
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...
53