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

OctosendHtmlRenderTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Starkerxp\CampaignBundle\Tests\Render;
4
5
use Starkerxp\CampaignBundle\Render\OctosendHtmlRender;
6
7 View Code Duplication
class OctosendHtmlRenderTest 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 OctosendHtmlRender */
10
    protected $renderService;
11
12
    public function setUp()
13
    {
14
        parent::setUp();
15
        $this->renderService = $this->getContainer()->get('starkerxp_campaign.render.octosend_html');
16
    }
17
18
    public function dataProvider()
19
    {
20
        $export = [
21
            'lien mirroir'        => [
22
                '[{@mirror}]',
23
                [],
24
                '{{mirror}}',
25
            ],
26
            'pixel'               => [
27
                '[{@pixel}]',
28
                [],
29
                '{{pixel}}',
30
            ],
31
            'lien desinscription' => [
32
                '<a data-id="unsub" target="__blank" href="http://google.fr" style="color:black;">Mon lien</a>',
33
                [],
34
                "<a href='{{unsubscribe:http://google.fr}}' style='color:black;' title='Désinscription'>Mon lien</a>",
35
            ],
36
            'lien clickable'      => [
37
                '<a data-id="click" target="__blank" href="http://google.fr" style="color:black;">Mon lien</a>',
38
                [],
39
                "<a href='{{click:http://google.fr}}' style='color:black;'>Mon lien</a>",
40
            ],
41
        ];
42
43
        return $export;
44
    }
45
46
    /**
47
     * @group campaign
48
     * @group render
49
     * @group octosend
50
     *
51
     * @dataProvider dataProvider
52
     */
53
    public function testRender($message, $params, $expected)
54
    {
55
        $this->renderService->setContenu($message);
56
        $this->renderService->setData($params);
57
        $actual = $this->renderService->render();
58
        $this->assertEquals($expected, $actual);
59
    }
60
}
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...
61