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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-04-20 12:04:36 +0300
committerdiosmosis <benaka@piwik.pro>2015-04-20 12:04:36 +0300
commitba368176b8b3d820e7236e26ddbcf1fb0abe2e0f (patch)
tree38228b66e71d737a831dae119710491fcbf979be /tests/PHPUnit/System/TrackerTest.php
parent146fe0df03bbca8d69153e2d4a3a024851d435e9 (diff)
Refs #7632, when getting user info in UserCountry dimensions, set language using request object not visitor object, since the Country dimension will be triggered before the Lanuage one. Includes test.
Diffstat (limited to 'tests/PHPUnit/System/TrackerTest.php')
-rw-r--r--tests/PHPUnit/System/TrackerTest.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/PHPUnit/System/TrackerTest.php b/tests/PHPUnit/System/TrackerTest.php
index 48d3a4e54d..5d38c74d51 100644
--- a/tests/PHPUnit/System/TrackerTest.php
+++ b/tests/PHPUnit/System/TrackerTest.php
@@ -12,6 +12,7 @@ use Piwik\Common;
use Piwik\Config;
use Piwik\Db;
use Piwik\Option;
+use Piwik\Plugins\UserCountry\LocationProvider;
use Piwik\Scheduler\Schedule\Schedule;
use Piwik\Scheduler\Task;
use Piwik\Scheduler\Timetable;
@@ -147,6 +148,23 @@ class TrackerTest extends IntegrationTestCase
$this->assertEquals(0, count($this->getConversionItems()));
}
+ public function test_trackingWithLangParameter_ForwardsLangParameter_ToDefaultLocationProvider()
+ {
+ LocationProvider::setCurrentProvider(LocationProvider\DefaultProvider::ID);
+
+ $urlToTest = "?idsite=1&rec=1&action_name=test&lang=fr-be";
+ $response = $this->sendTrackingRequestByCurl($urlToTest);
+ Fixture::checkResponse($response);
+
+ $logVisitTable = Common::prefixTable('log_visit');
+
+ $visitCount = Db::fetchOne("SELECT COUNT(*) FROM $logVisitTable");
+ $this->assertEquals(1, $visitCount);
+
+ $visitCountry = Db::fetchOne("SELECT location_country FROM $logVisitTable");
+ $this->assertEquals('be', $visitCountry);
+ }
+
public function test_scheduledTasks_CanBeRunThroughTracker_WithoutIncludingOutputInTrackerOutput()
{
$this->setScheduledTasksToRunInTracker();