CodeBuilderTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testRender() 0 4 1
1
<?php
2
/**
3
 * Yandex.Metrika counter for Yii2 applications
4
 *
5
 * @link      https://github.com/hiqdev/yii2-yandex-metrika
6
 * @package   yii2-yandex-metrika
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\yii2\YandexMetrika\tests;
12
13
use hiqdev\yii2\YandexMetrika\CodeBuilder;
14
use Yii;
15
16
class CodeBuilderTest extends \PHPUnit\Framework\TestCase
17
{
18
    protected $builder;
19
20
    protected $id = 12345678;
21
22
    protected $params = [
23
        'cilckmap'              => true,
24
        'webvisor'              => true,
25
        'trackLinks'            => true,
26
        'accurateTrackBounce'   => true,
27
    ];
28
29
    protected function setUp()
30
    {
31
        $this->builder = Yii::createObject([
32
            'class' => CodeBuilder::class,
33
            'id' => $this->id,
34
            'params' => $this->params,
35
        ]);
36
    }
37
38
    public function testRender()
39
    {
40
        $sample = file_get_contents(__DIR__ . '/code.html');
41
        $this->assertSame(trim($sample), trim($this->builder->render()));
42
    }
43
}
44