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

Utf8mb4.php « Fixtures « PHPUnit « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e2365e49d4b55edb0d5bcf385ffd31327b8eae5d (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
<?php
/**
 * Matomo - 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\Date;
use Piwik\Tests\Framework\Fixture;

/**
 *
 */
class Utf8mb4 extends Fixture
{
    public $idSite = 1;
    public $dateTime = '2010-01-04 00:11:42';

    public $trackInvalidRequests = true;

    public function setUp(): void
    {
        $this->setUpWebsitesAndGoals();
        $this->trackVisits();
    }

    public function tearDown(): void
    {
        // empty
    }

    private function setUpWebsitesAndGoals()
    {
        if (!self::siteCreated($idSite = 1)) {
            self::createWebsite($this->dateTime);
        }
    }

    private function trackVisits()
    {
        $t = self::getTracker($this->idSite, $this->dateTime, $defaultInit = true);
        $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(1)->getDatetime());
        $t->setUrlReferrer('http://www.google.com/search?q=😡');
        $t->setUrl('http://example.org/foo/🙙.html');
        self::checkResponse($t->doTrackPageView('incredible 🚜'));

        $t->addEcommerceItem('sku 🛸', 'name 🛩', 'category 🛤', 95);
        self::checkResponse($t->doTrackEcommerceCartUpdate(100));
    }
}