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

TwoVisitsWithCustomVariablesTest.php « Integration « PHPUnit « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 932ef4ef8b9bcff67c17d957ea59c724fc9b59ee (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
54
55
56
57
58
59
<?php
/**
 * Piwik - Open source web analytics
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

/**
 * Tests w/ two visits & custom variables.
 */
class Test_Piwik_Integration_TwoVisitsWithCustomVariables extends IntegrationTestCase
{
    public static $fixture = null; // initialized below class definition

    public function getApiForTesting()
    {
        $idSite = self::$fixture->idSite;
        $dateTime = self::$fixture->dateTime;

        $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');

        $return = array(
            array($apiToCall, array('idSite'       => 'all',
                                    'date'         => $dateTime,
                                    'periods'      => array('day', 'week'),
                                    'setDateLastN' => true)),

            // test getProcessedReport w/ custom variables subtable
            array('API.getProcessedReport', array('idSite'        => $idSite,
                                                  'date'          => $dateTime,
                                                  'periods'       => 'day',
                                                  'apiModule'     => 'CustomVariables',
                                                  'apiAction'     => 'getCustomVariablesValuesFromNameId',
                                                  'supertableApi' => 'CustomVariables.getCustomVariables',
                                                  'testSuffix'    => '__subtable')),
        );

        return $return;
    }

    /**
     * @dataProvider getApiForTesting
     * @group        Integration
     * @group        TwoVisitsWithCustomVariables
     */
    public function testApi($api, $params)
    {
        $this->runApiTests($api, $params);
    }

    public static function getOutputPrefix()
    {
        return 'twoVisitsWithCustomVariables';
    }
}

Test_Piwik_Integration_TwoVisitsWithCustomVariables::$fixture = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables();