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

JSTrackingUIFixture.php « Fixtures « PHPUnit « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9aebb3e0a0c46cd13f46abfb13ad70cf7595b195 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 */

namespace Piwik\Tests\Fixtures;

use Piwik\Plugins\GeoIp2\LocationProvider\GeoIp2\Php;
use Piwik\Plugins\PrivacyManager\IPAnonymizer;
use Piwik\Plugins\UserCountry\LocationProvider;
use Piwik\Tests\Framework\Fixture;

class JSTrackingUIFixture extends Fixture
{
    public function setUp(): void
    {
        parent::setUp();

        self::resetPluginsInstalledConfig();
        self::updateDatabase();
        self::installAndActivatePlugins($this->getTestEnvironment());
        self::updateDatabase();

        // for proper geolocation
        LocationProvider::setCurrentProvider(Php::ID);
        IPAnonymizer::deactivate();

        Fixture::createWebsite('2012-02-02 00:00:00');
    }

    public function performSetUp($setupEnvironmentOnly = false)
    {
        $this->extraTestEnvVars = array(
            'loadRealTranslations' => 1,
        );
        $this->extraPluginsToLoad = array(
            'ExampleTracker',
        );

        parent::performSetUp($setupEnvironmentOnly);

        $this->testEnvironment->overlayUrl = UITestFixture::getLocalTestSiteUrl();
        UITestFixture::createOverlayTestSite($idSite = 1);

        $this->testEnvironment->tokenAuth = self::getTokenAuth();
        $this->testEnvironment->pluginsToLoad = $this->extraPluginsToLoad;
        $this->testEnvironment->save();
    }
}