Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PiwikJsContentTest.php « System « tests « CustomPiwikJs « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dd3f08ab3ae51bd9d309d38080743ca28817563f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

namespace Piwik\Plugins\CustomPiwikJs\tests\System;

use Piwik\Plugins\CustomPiwikJs\TrackerUpdater;
use Piwik\Plugins\CustomPiwikJs\TrackingCode\PiwikJsManipulator;
use Piwik\Tests\Framework\TestCase\SystemTestCase;

/**
 * @group CustomPiwikJs
 * @group PiwikJsContentTest
 * @group PiwikJsContent
 * @group Plugins
 */
class PiwikJsContentTest extends SystemTestCase
{
    public function test_piwikJsAndPiwikMinJsMustHaveSameContent()
    {
        $piwikMin = PIWIK_DOCUMENT_ROOT . TrackerUpdater::ORIGINAL_PIWIK_JS;
        $piwikJs = PIWIK_DOCUMENT_ROOT . TrackerUpdater::TARGET_PIWIK_JS;

        $this->assertSame(file_get_contents($piwikMin), file_get_contents($piwikJs));
    }

    public function test_piwikJsContainsHook()
    {
        $piwikMin = PIWIK_DOCUMENT_ROOT . '/js/piwik.min.js';
        $content  = file_get_contents($piwikMin);

        $this->assertContains(PiwikJsManipulator::HOOK, $content);
    }

}