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

OneVisitWithSiteSearch.php « Fixtures « PHPUnit « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bf0f8f14a1de1a6a5bc45d05b5070a65e4dbf01e (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
<?php

namespace Piwik\Tests\Fixtures;

use Piwik\Tests\Framework\Fixture;

class OneVisitWithSiteSearch extends Fixture
{
    public $dateTime = '2012-01-11 07:22:33';
    public $idSite = 1;

    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()
    {
        $tracker = self::getTracker($this->idSite, $this->dateTime, true);

        $tracker->setTokenAuth(self::getTokenAuth());
        $tracker->setUrl('http://example.org/sites/search.html');
        $tracker->setForceVisitDateTime($this->dateTime);

        self::checkResponse(
            $tracker->doTrackSiteSearch(
                'title%3A"test"+AND+body%3A"test"+AND+spaceCategory%3AALL+AND+startIndex%3A0+AND+pageSize%3A10',
                '',
                3
            )
        );
    }
}